1 # Generated from ltmain.m4sh.
3 # ltmain.sh (GNU libtool) 2.2.4
4 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
6 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
7 # This is free software; see the source for copying conditions. There is NO
8 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 # GNU Libtool is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 2 of the License, or
13 # (at your option) any later version.
15 # As a special exception to the GNU General Public License,
16 # if you distribute this file as part of a program or library that
17 # is built using GNU Libtool, you may include this file under the
18 # same distribution terms that you use for the rest of that program.
20 # GNU Libtool is distributed in the hope that it will be useful, but
21 # WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 # General Public License for more details.
25 # You should have received a copy of the GNU General Public License
26 # along with GNU Libtool; see the file COPYING. If not, a copy
27 # can be downloaded from http://www.gnu.org/licenses/gpl.html,
28 # or obtained by writing to the Free Software Foundation, Inc.,
29 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
31 # Usage: $progname [OPTION]... [MODE-ARG]...
33 # Provide generalized library-building support services.
35 # --config show all configuration variables
36 # --debug enable verbose shell tracing
37 # -n, --dry-run display commands without modifying any files
38 # --features display basic configuration information and exit
39 # --mode=MODE use operation mode MODE
40 # --preserve-dup-deps don't remove duplicate dependency libraries
41 # --quiet, --silent don't print informational messages
42 # --tag=TAG use configuration variables from tag TAG
43 # -v, --verbose print informational messages (default)
44 # --version print version information
45 # -h, --help print short or long help message
47 # MODE must be one of the following:
49 # clean remove files from the build directory
50 # compile compile a source file into a libtool object
51 # execute automatically set library path, then run a program
52 # finish complete the installation of libtool libraries
53 # install install libraries or executables
54 # link create a library or an executable
55 # uninstall remove libraries from an installed directory
57 # MODE-ARGS vary depending on the MODE.
58 # Try `$progname --help --mode=MODE' for a more detailed description of MODE.
60 # When reporting a bug, please describe a test case to reproduce it and
61 # include the following information:
66 # compiler flags: $LTCFLAGS
67 # linker: $LD (gnu? $with_gnu_ld)
68 # $progname: (GNU libtool) 2.2.4
69 # automake: $automake_version
70 # autoconf: $autoconf_version
72 # Report bugs to <bug-libtool@gnu.org>.
78 package_revision=1.2976
80 # Be Bourne compatible
81 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
84 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
85 # is contrary to our usage. Disable this feature.
86 alias -g '${1+"$@"}'='"$@"'
89 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
91 BIN_SH=xpg4; export BIN_SH # for Tru64
92 DUALCASE=1; export DUALCASE # for MKS sh
94 # NLS nuisances: We save the old values to restore during execute mode.
95 # Only set LANG and LC_ALL to C if already set.
96 # These must not be set unconditionally because not all systems understand
97 # e.g. LANG=C (notably SCO).
100 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
102 eval "if test \"\${$lt_var+set}\" = set; then
103 save_$lt_var=\$$lt_var
106 lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
107 lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
119 : ${EGREP="/usr/bin/grep -E"}
120 : ${FGREP="/usr/bin/grep -F"}
121 : ${GREP="/usr/bin/grep"}
127 : ${SED="/opt/local/bin/gsed"}
128 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
129 : ${Xsed="$SED -e 1s/^X//"}
134 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
135 EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
137 exit_status=$EXIT_SUCCESS
139 # Make sure IFS has a sensible default
144 dirname="s,/[^/]*$,,"
147 # func_dirname_and_basename file append nondir_replacement
148 # perform func_basename and func_dirname in a single function
150 # dirname: Compute the dirname of FILE. If nonempty,
151 # add APPEND to the result, otherwise set result
152 # to NONDIR_REPLACEMENT.
153 # value returned in "$func_dirname_result"
154 # basename: Compute filename of FILE.
155 # value retuned in "$func_basename_result"
156 # Implementation must be kept synchronized with func_dirname
157 # and func_basename. For efficiency, we do not delegate to
158 # those functions but instead duplicate the functionality here.
159 func_dirname_and_basename ()
161 # Extract subdirectory from the argument.
162 func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
163 if test "X$func_dirname_result" = "X${1}"; then
164 func_dirname_result="${3}"
166 func_dirname_result="$func_dirname_result${2}"
168 func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
171 # Generated shell functions inserted here.
173 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
174 # is ksh but when the shell is invoked as "sh" and the current value of
175 # the _XPG environment variable is not equal to 1 (one), the special
176 # positional parameter $0, within a function call, is the name of the
180 # The name of this program:
181 # In the unlikely event $progname began with a '-', it would play havoc with
182 # func_echo (imagine progname=-n), so we prepend ./ in that case:
183 func_dirname_and_basename "$progpath"
184 progname=$func_basename_result
186 -*) progname=./$progname ;;
189 # Make sure we have an absolute path for reexecution:
191 [\\/]*|[A-Za-z]:\\*) ;;
193 progdir=$func_dirname_result
194 progdir=`cd "$progdir" && pwd`
195 progpath="$progdir/$progname"
200 for progdir in $PATH; do
202 test -x "$progdir/$progname" && break
205 test -n "$progdir" || progdir=`pwd`
206 progpath="$progdir/$progname"
210 # Sed substitution that helps us do robust quoting. It backslashifies
211 # metacharacters that are still active within double-quoted strings.
212 Xsed="${SED}"' -e 1s/^X//'
213 sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
215 # Same as above, but do not quote variable references.
216 double_quote_subst='s/\(["`\\]\)/\\\1/g'
218 # Re-`\' parameter expansions in output of double_quote_subst that were
219 # `\'-ed in input to the same. If an odd number of `\' preceded a '$'
220 # in input to double_quote_subst, that '$' was protected from expansion.
221 # Since each input `\' is now two `\'s, look for any number of runs of
222 # four `\'s followed by two `\'s and then a '$'. `\' that '$'.
227 sed_double_backslash="\
231 s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
242 # Echo program name prefixed message, along with the current mode
243 # name if it has been set yet.
246 $ECHO "$progname${mode+: }$mode: $*"
249 # func_verbose arg...
250 # Echo program name prefixed message in verbose mode only.
253 $opt_verbose && func_echo ${1+"$@"}
255 # A bug in bash halts the script if the last line of a function
256 # fails when set -e is in force, so we need another command to
262 # Echo program name prefixed message to standard error.
265 $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
268 # func_warning arg...
269 # Echo program name prefixed warning message to standard error.
272 $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
278 # func_fatal_error arg...
279 # Echo program name prefixed message to standard error, and exit.
286 # func_fatal_help arg...
287 # Echo program name prefixed message to standard error, followed by
288 # a help hint, and exit.
292 func_fatal_error "$help"
294 help="Try \`$progname --help' for more information." ## default
297 # func_grep expression filename
298 # Check whether EXPRESSION matches any line of FILENAME, without output.
301 $GREP "$1" "$2" >/dev/null 2>&1
305 # func_mkdir_p directory-path
306 # Make sure the entire path to DIRECTORY-PATH is available.
309 my_directory_path="$1"
312 if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
314 # Protect directory names starting with `-'
315 case $my_directory_path in
316 -*) my_directory_path="./$my_directory_path" ;;
319 # While some portion of DIR does not yet exist...
320 while test ! -d "$my_directory_path"; do
321 # ...make a list in topmost first order. Use a colon delimited
322 # list incase some portion of path contains whitespace.
323 my_dir_list="$my_directory_path:$my_dir_list"
325 # If the last portion added has no slash in it, the list is done
326 case $my_directory_path in */*) ;; *) break ;; esac
328 # ...otherwise throw away the child directory and loop
329 my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
331 my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
333 save_mkdir_p_IFS="$IFS"; IFS=':'
334 for my_dir in $my_dir_list; do
335 IFS="$save_mkdir_p_IFS"
336 # mkdir can fail with a `File exist' error if two processes
337 # try to create one of the directories concurrently. Don't
339 $MKDIR "$my_dir" 2>/dev/null || :
341 IFS="$save_mkdir_p_IFS"
343 # Bail out if we (or some other process) failed to create a directory.
344 test -d "$my_directory_path" || \
345 func_fatal_error "Failed to create \`$1'"
350 # func_mktempdir [string]
351 # Make a temporary directory that won't clash with other running
352 # libtool processes, and avoids race conditions if possible. If
353 # given, STRING is the basename for that directory.
356 my_template="${TMPDIR-/tmp}/${1-$progname}"
358 if test "$opt_dry_run" = ":"; then
359 # Return a directory name, but don't create it in dry-run mode
360 my_tmpdir="${my_template}-$$"
363 # If mktemp works, use that first and foremost
364 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
366 if test ! -d "$my_tmpdir"; then
367 # Failing that, at least try and use $RANDOM to avoid a race
368 my_tmpdir="${my_template}-${RANDOM-0}$$"
370 save_mktempdir_umask=`umask`
373 umask $save_mktempdir_umask
376 # If we're not in dry-run mode, bomb out on failure
377 test -d "$my_tmpdir" || \
378 func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
381 $ECHO "X$my_tmpdir" | $Xsed
385 # func_quote_for_eval arg
386 # Aesthetically quote ARG to be evaled later.
387 # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
388 # is double-quoted, suitable for a subsequent eval, whereas
389 # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
390 # which are still active within double quotes backslashified.
391 func_quote_for_eval ()
395 func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
397 func_quote_for_eval_unquoted_result="$1" ;;
400 case $func_quote_for_eval_unquoted_result in
401 # Double-quote args containing shell metacharacters to delay
402 # word splitting, command substitution and and variable
403 # expansion for a subsequent eval.
404 # Many Bourne shells cannot handle close brackets correctly
405 # in scan sets, so we specify it separately.
406 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
407 func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
410 func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
415 # func_quote_for_expand arg
416 # Aesthetically quote ARG to be evaled later; same as above,
417 # but do not quote variable references.
418 func_quote_for_expand ()
422 my_arg=`$ECHO "X$1" | $Xsed \
423 -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
429 # Double-quote args containing shell metacharacters to delay
430 # word splitting and command substitution for a subsequent eval.
431 # Many Bourne shells cannot handle close brackets correctly
432 # in scan sets, so we specify it separately.
433 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
438 func_quote_for_expand_result="$my_arg"
442 # func_show_eval cmd [fail_exp]
443 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
444 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
445 # is given, then evaluate it.
451 ${opt_silent-false} || {
452 func_quote_for_expand "$my_cmd"
453 eval "func_echo $func_quote_for_expand_result"
456 if ${opt_dry_run-false}; then :; else
459 if test "$my_status" -eq 0; then :; else
460 eval "(exit $my_status); $my_fail_exp"
466 # func_show_eval_locale cmd [fail_exp]
467 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
468 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
469 # is given, then evaluate it. Use the saved locale for evaluation.
470 func_show_eval_locale ()
475 ${opt_silent-false} || {
476 func_quote_for_expand "$my_cmd"
477 eval "func_echo $func_quote_for_expand_result"
480 if ${opt_dry_run-false}; then :; else
481 eval "$lt_user_locale
484 eval "$lt_safe_locale"
485 if test "$my_status" -eq 0; then :; else
486 eval "(exit $my_status); $my_fail_exp"
496 # Echo version message to standard output and exit.
499 $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
502 s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
509 # Echo short help message to standard output and exit.
512 $SED -n '/^# Usage:/,/# -h/ {
515 s/\$progname/'$progname'/
519 $ECHO "run \`$progname --help | more' for full usage"
524 # Echo long help message to standard output and exit.
527 $SED -n '/^# Usage:/,/# Report bugs to/ {
530 s*\$progname*'$progname'*
532 s*\$SHELL*'"$SHELL"'*
534 s*\$LTCFLAGS*'"$LTCFLAGS"'*
536 s/\$with_gnu_ld/'"$with_gnu_ld"'/
537 s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
538 s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
544 # func_missing_arg argname
545 # Echo program name prefixed message to standard error and set global
549 func_error "missing argument for $1"
559 # Check that we have a working $ECHO.
560 if test "X$1" = X--no-reexec; then
561 # Discard the --no-reexec flag, and continue.
563 elif test "X$1" = X--fallback-echo; then
564 # Avoid inline document here, it may be left over
566 elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
567 # Yippee, $ECHO works!
570 # Restart under the correct shell, and then maybe $ECHO will work.
571 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
573 # Same for EGREP, and just to be sure, do LTCC as well
574 if test "x$EGREP" = x ; then
577 if test "x$LTCC" = x ; then
581 if test "X$1" = X--fallback-echo; then
582 # used as fallback echo
590 magic="%%%MAGIC variable%%%"
591 magic_exe="%%%MAGIC EXE variable%%%"
598 lo2o="s/\\.lo\$/.${objext}/"
599 o2lo="s/\\.${objext}\$/.lo/"
604 opt_duplicate_deps=false
608 # If this variable is set in any of the actions, the command in it
609 # will be execed at the end. This prevents here-documents from being
610 # left over by shells.
613 # func_fatal_configuration arg...
614 # Echo program name prefixed message to standard error, followed by
615 # a configuration failure hint, and exit.
616 func_fatal_configuration ()
619 func_error "See the $PACKAGE documentation for more information."
620 func_fatal_error "Fatal configuration error."
625 # Display the configuration for all the tags in this script.
628 re_begincf='^# ### BEGIN LIBTOOL'
629 re_endcf='^# ### END LIBTOOL'
631 # Default configuration.
632 $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
634 # Now print the configurations for the tags.
635 for tagname in $taglist; do
636 $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
643 # Display the features supported by this script.
647 if test "$build_libtool_libs" = yes; then
648 $ECHO "enable shared libraries"
650 $ECHO "disable shared libraries"
652 if test "$build_old_libs" = yes; then
653 $ECHO "enable static libraries"
655 $ECHO "disable static libraries"
661 # func_enable_tag tagname
662 # Verify that TAGNAME is valid, and either flag an error and exit, or
663 # enable the TAGNAME tag. We also add TAGNAME to the global $taglist
670 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
671 re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
672 sed_extractcf="/$re_begincf/,/$re_endcf/p"
677 func_fatal_error "invalid tag name: $tagname"
681 # Don't test for the "default" C tag, as we know it's
682 # there but not specially marked.
686 if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
687 taglist="$taglist $tagname"
689 # Evaluate the configuration. Be careful to quote the path
690 # and the sed script, to avoid splitting on whitespace, but
691 # also don't use non-portable quotes within backquotes within
692 # quotes we have to do it in 2 steps:
693 extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
696 func_error "ignoring unknown tag $tagname"
702 # Parse options once, thoroughly. This comes as soon as possible in
703 # the script to make things like `libtool --version' happen quickly.
706 # Shorthand for --mode=foo, only valid as the first argument
709 shift; set dummy --mode clean ${1+"$@"}; shift
711 compile|compil|compi|comp|com|co|c)
712 shift; set dummy --mode compile ${1+"$@"}; shift
714 execute|execut|execu|exec|exe|ex|e)
715 shift; set dummy --mode execute ${1+"$@"}; shift
717 finish|finis|fini|fin|fi|f)
718 shift; set dummy --mode finish ${1+"$@"}; shift
720 install|instal|insta|inst|ins|in|i)
721 shift; set dummy --mode install ${1+"$@"}; shift
724 shift; set dummy --mode link ${1+"$@"}; shift
726 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
727 shift; set dummy --mode uninstall ${1+"$@"}; shift
731 # Parse non-mode specific arguments:
732 while test "$#" -gt 0; do
737 --config) func_config ;;
739 --debug) preserve_args="$preserve_args $opt"
740 func_echo "enabling shell trace mode"
745 -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break
746 execute_dlfiles="$execute_dlfiles $1"
750 --dry-run | -n) opt_dry_run=: ;;
751 --features) func_features ;;
752 --finish) mode="finish" ;;
754 --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break
756 # Valid mode arguments:
766 # Catch anything else as an error
767 *) func_error "invalid argument for $opt"
778 opt_duplicate_deps=: ;;
780 --quiet|--silent) preserve_args="$preserve_args $opt"
784 --verbose| -v) preserve_args="$preserve_args $opt"
788 --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break
789 preserve_args="$preserve_args $opt $1"
790 func_enable_tag "$1" # tagname is set here
794 # Separate optargs to long options:
795 -dlopen=*|--mode=*|--tag=*)
796 func_opt_split "$opt"
797 set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
801 -\?|-h) func_usage ;;
802 --help) opt_help=: ;;
803 --version) func_version ;;
805 -*) func_fatal_help "unrecognized option \`$opt'" ;;
815 *cygwin* | *mingw* | *pw32*)
816 # don't eliminate duplications in $postdeps and $predeps
817 opt_duplicate_compiler_generated_deps=:
820 opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
824 # Having warned about all mis-specified options, bail out if
825 # anything was wrong.
826 $exit_cmd $EXIT_FAILURE
829 # func_check_version_match
830 # Ensure that we are using m4 macros, and libtool script from the same
831 # release of libtool.
832 func_check_version_match ()
834 if test "$package_revision" != "$macro_revision"; then
835 if test "$VERSION" != "$macro_version"; then
836 if test -z "$macro_version"; then
838 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
839 $progname: definition of this LT_INIT comes from an older release.
840 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
841 $progname: and run autoconf again.
845 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
846 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
847 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
848 $progname: and run autoconf again.
853 $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
854 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
855 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
856 $progname: of $PACKAGE $VERSION and run autoconf again.
870 # Sanity checks first:
871 func_check_version_match
873 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
874 func_fatal_configuration "not configured to build any kind of library"
877 test -z "$mode" && func_fatal_error "error: you must specify a MODE."
881 eval std_shrext=\"$shrext_cmds\"
884 # Only execute mode is allowed to have -dlopen flags.
885 if test -n "$execute_dlfiles" && test "$mode" != execute; then
886 func_error "unrecognized option \`-dlopen'"
891 # Change the help message to a mode-specific one.
893 help="Try \`$progname --help --mode=$mode' for more information."
898 # True iff FILE is a libtool `.la' library or `.lo' object file.
899 # This function is only a basic sanity check; it will hardly flush out
900 # determined imposters.
903 $SED -e 4q "$1" 2>/dev/null \
904 | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
907 # func_lalib_unsafe_p file
908 # True iff FILE is a libtool `.la' library or `.lo' object file.
909 # This function implements the same check as func_lalib_p without
910 # resorting to external programs. To this end, it redirects stdin and
911 # closes it afterwards, without saving the original file descriptor.
912 # As a safety measure, use it only where a negative result would be
913 # fatal anyway. Works if `file' does not exist.
914 func_lalib_unsafe_p ()
917 if test -r "$1" && exec 5<&0 <"$1"; then
918 for lalib_p_l in 1 2 3 4
921 case "$lalib_p_line" in
922 \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
927 test "$lalib_p" = yes
930 # func_ltwrapper_script_p file
931 # True iff FILE is a libtool wrapper script
932 # This function is only a basic sanity check; it will hardly flush out
933 # determined imposters.
934 func_ltwrapper_script_p ()
939 # func_ltwrapper_executable_p file
940 # True iff FILE is a libtool wrapper executable
941 # This function is only a basic sanity check; it will hardly flush out
942 # determined imposters.
943 func_ltwrapper_executable_p ()
945 func_ltwrapper_exec_suffix=
948 *) func_ltwrapper_exec_suffix=.exe ;;
950 $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
953 # func_ltwrapper_scriptname file
954 # Assumes file is an ltwrapper_executable
955 # uses $file to determine the appropriate filename for a
956 # temporary ltwrapper_script.
957 func_ltwrapper_scriptname ()
959 func_ltwrapper_scriptname_result=""
960 if func_ltwrapper_executable_p "$1"; then
961 func_dirname_and_basename "$1" "" "."
962 func_stripname '' '.exe' "$func_basename_result"
963 func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
967 # func_ltwrapper_p file
968 # True iff FILE is a libtool wrapper script or wrapper executable
969 # This function is only a basic sanity check; it will hardly flush out
970 # determined imposters.
973 func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
977 # func_execute_cmds commands fail_cmd
978 # Execute tilde-delimited COMMANDS.
979 # If FAIL_CMD is given, eval that upon failure.
980 # FAIL_CMD may read-access the current command in variable CMD!
984 save_ifs=$IFS; IFS='~'
988 func_show_eval "$cmd" "${2-:}"
995 # Source FILE, adding directory component if necessary.
996 # Note that it is not necessary on cygwin/mingw to append a dot to
997 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
998 # behavior happens only for exec(3), not for open(2)! Also, sourcing
999 # `FILE.' does not work on cygwin managed mounts.
1004 */* | *\\*) . "$1" ;;
1010 # func_infer_tag arg
1011 # Infer tagged configuration to use if any are available and
1012 # if one wasn't chosen via the "--tag" command line option.
1013 # Only attempt this if the compiler in the base compile
1014 # command doesn't match the default compiler.
1015 # arg is usually of the form 'gcc ...'
1019 if test -n "$available_tags" && test -z "$tagname"; then
1022 func_quote_for_eval "$arg"
1023 CC_quoted="$CC_quoted $func_quote_for_eval_result"
1026 # Blanks in the command may have been stripped by the calling shell,
1027 # but not from the CC environment variable when configure was run.
1028 " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
1029 # Blanks at the start of $base_compile will cause this to fail
1030 # if we don't check for them as well.
1032 for z in $available_tags; do
1033 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
1034 # Evaluate the configuration.
1035 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1038 # Double-quote args containing other shell metacharacters.
1039 func_quote_for_eval "$arg"
1040 CC_quoted="$CC_quoted $func_quote_for_eval_result"
1043 " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
1044 # The compiler in the base compile command matches
1045 # the one in the tagged configuration.
1046 # Assume this is the tagged configuration we want.
1053 # If $tagname still isn't set, then no tagged configuration
1054 # was found and let the user know that the "--tag" command
1055 # line option must be used.
1056 if test -z "$tagname"; then
1057 func_echo "unable to infer tagged configuration"
1058 func_fatal_error "specify a tag with \`--tag'"
1060 # func_verbose "using $tagname tagged configuration"
1069 # func_write_libtool_object output_name pic_name nonpic_name
1070 # Create a libtool object file (analogous to a ".la" file),
1071 # but don't create it if we're doing a dry run.
1072 func_write_libtool_object ()
1075 if test "$build_libtool_libs" = yes; then
1081 if test "$build_old_libs" = yes; then
1082 write_oldobj=\'${3}\'
1088 cat >${write_libobj}T <<EOF
1089 # $write_libobj - a libtool object file
1090 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
1092 # Please DO NOT delete this file!
1093 # It is necessary for linking the library.
1095 # Name of the PIC object.
1096 pic_object=$write_lobj
1098 # Name of the non-PIC object
1099 non_pic_object=$write_oldobj
1102 $MV "${write_libobj}T" "${write_libobj}"
1106 # func_mode_compile arg...
1107 func_mode_compile ()
1110 # Get the compilation command and the source file.
1112 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
1124 # do not "continue". Instead, add this to base_compile
1136 # Accept any command-line options.
1139 test -n "$libobj" && \
1140 func_fatal_error "you cannot specify \`-o' more than once"
1145 -pie | -fpie | -fPIE)
1146 pie_flag="$pie_flag $arg"
1150 -shared | -static | -prefer-pic | -prefer-non-pic)
1161 arg_mode=arg # the next one goes into the "base_compile" arg list
1162 continue # The current "srcfile" will either be retained or
1163 ;; # replaced later. I would guess that would be a bug.
1166 func_stripname '-Wc,' '' "$arg"
1167 args=$func_stripname_result
1169 save_ifs="$IFS"; IFS=','
1170 for arg in $args; do
1172 func_quote_for_eval "$arg"
1173 lastarg="$lastarg $func_quote_for_eval_result"
1176 func_stripname ' ' '' "$lastarg"
1177 lastarg=$func_stripname_result
1179 # Add the arguments to base_compile.
1180 base_compile="$base_compile $lastarg"
1185 # Accept the current argument as the source file.
1186 # The previous "srcfile" becomes the current argument.
1193 esac # case $arg_mode
1195 # Aesthetically quote the previous argument.
1196 func_quote_for_eval "$lastarg"
1197 base_compile="$base_compile $func_quote_for_eval_result"
1202 func_fatal_error "you must specify an argument for -Xcompile"
1205 func_fatal_error "you must specify a target with \`-o'"
1208 # Get the name of the library object.
1209 test -z "$libobj" && {
1210 func_basename "$srcfile"
1211 libobj="$func_basename_result"
1216 # Recognize several different file suffixes.
1217 # If the user specifies -o file.o, it is replaced with file.lo
1220 *.ada | *.adb | *.ads | *.asm | \
1221 *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
1222 *.[fF][09]? | *.for | *.java | *.obj | *.sx)
1223 func_xform "$libobj"
1224 libobj=$func_xform_result
1229 *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
1231 func_fatal_error "cannot determine name of library object from \`$libobj'"
1235 func_infer_tag $base_compile
1237 for arg in $later; do
1240 test "$build_libtool_libs" != yes && \
1241 func_fatal_configuration "can not build a shared library"
1247 build_libtool_libs=no
1264 func_quote_for_eval "$libobj"
1265 test "X$libobj" != "X$func_quote_for_eval_result" \
1266 && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
1267 && func_warning "libobj name \`$libobj' may not contain shell special characters."
1268 func_dirname_and_basename "$obj" "/" ""
1269 objname="$func_basename_result"
1270 xdir="$func_dirname_result"
1271 lobj=${xdir}$objdir/$objname
1273 test -z "$base_compile" && \
1274 func_fatal_help "you must specify a compilation command"
1276 # Delete any leftover library objects.
1277 if test "$build_old_libs" = yes; then
1278 removelist="$obj $lobj $libobj ${libobj}T"
1280 removelist="$lobj $libobj ${libobj}T"
1283 # On Cygwin there's no "real" PIC flag so we must build both object types
1285 cygwin* | mingw* | pw32* | os2*)
1289 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
1290 # non-PIC code in shared libraries is not supported
1294 # Calculate the filename of the output object if compiler does
1295 # not support -o with -c
1296 if test "$compiler_c_o" = no; then
1297 output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
1298 lockfile="$output_obj.lock"
1305 # Lock this critical section if it is needed
1306 # We use this script file to make the link, it avoids creating a new file
1307 if test "$need_locks" = yes; then
1308 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
1309 func_echo "Waiting for $lockfile to be removed"
1312 elif test "$need_locks" = warn; then
1313 if test -f "$lockfile"; then
1315 *** ERROR, $lockfile exists and contains:
1316 `cat $lockfile 2>/dev/null`
1318 This indicates that another process is trying to use the same
1319 temporary object file, and libtool could not work around it because
1320 your compiler does not support \`-c' and \`-o' together. If you
1321 repeat this compilation, it may succeed, by chance, but you had better
1322 avoid parallel builds (make -j) in this platform, or get a better
1325 $opt_dry_run || $RM $removelist
1328 removelist="$removelist $output_obj"
1329 $ECHO "$srcfile" > "$lockfile"
1332 $opt_dry_run || $RM $removelist
1333 removelist="$removelist $lockfile"
1334 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
1336 if test -n "$fix_srcfile_path"; then
1337 eval srcfile=\"$fix_srcfile_path\"
1339 func_quote_for_eval "$srcfile"
1340 qsrcfile=$func_quote_for_eval_result
1342 # Only build a PIC object if we are building libtool libraries.
1343 if test "$build_libtool_libs" = yes; then
1344 # Without this assignment, base_compile gets emptied.
1345 fbsd_hideous_sh_bug=$base_compile
1347 if test "$pic_mode" != no; then
1348 command="$base_compile $qsrcfile $pic_flag"
1350 # Don't build PIC code
1351 command="$base_compile $qsrcfile"
1354 func_mkdir_p "$xdir$objdir"
1356 if test -z "$output_obj"; then
1357 # Place PIC objects in $objdir
1358 command="$command -o $lobj"
1361 func_show_eval_locale "$command" \
1362 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
1364 if test "$need_locks" = warn &&
1365 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1367 *** ERROR, $lockfile contains:
1368 `cat $lockfile 2>/dev/null`
1370 but it should contain:
1373 This indicates that another process is trying to use the same
1374 temporary object file, and libtool could not work around it because
1375 your compiler does not support \`-c' and \`-o' together. If you
1376 repeat this compilation, it may succeed, by chance, but you had better
1377 avoid parallel builds (make -j) in this platform, or get a better
1380 $opt_dry_run || $RM $removelist
1384 # Just move the object if needed, then go on to compile the next one
1385 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1386 func_show_eval '$MV "$output_obj" "$lobj"' \
1387 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
1390 # Allow error messages only from the first compilation.
1391 if test "$suppress_opt" = yes; then
1392 suppress_output=' >/dev/null 2>&1'
1396 # Only build a position-dependent object if we build old libraries.
1397 if test "$build_old_libs" = yes; then
1398 if test "$pic_mode" != yes; then
1399 # Don't build PIC code
1400 command="$base_compile $qsrcfile$pie_flag"
1402 command="$base_compile $qsrcfile $pic_flag"
1404 if test "$compiler_c_o" = yes; then
1405 command="$command -o $obj"
1408 # Suppress compiler output if we already did a PIC compilation.
1409 command="$command$suppress_output"
1410 func_show_eval_locale "$command" \
1411 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
1413 if test "$need_locks" = warn &&
1414 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1416 *** ERROR, $lockfile contains:
1417 `cat $lockfile 2>/dev/null`
1419 but it should contain:
1422 This indicates that another process is trying to use the same
1423 temporary object file, and libtool could not work around it because
1424 your compiler does not support \`-c' and \`-o' together. If you
1425 repeat this compilation, it may succeed, by chance, but you had better
1426 avoid parallel builds (make -j) in this platform, or get a better
1429 $opt_dry_run || $RM $removelist
1433 # Just move the object if needed
1434 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1435 func_show_eval '$MV "$output_obj" "$obj"' \
1436 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
1441 func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
1443 # Unlock the critical section if it was locked
1444 if test "$need_locks" != no; then
1445 removelist=$lockfile
1454 test "$mode" = compile && func_mode_compile ${1+"$@"}
1459 # We need to display help for each of the modes.
1462 # Generic help is extracted from the usage comments
1463 # at the start of this file.
1469 "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
1471 Remove files from the build directory.
1473 RM is the name of the program to use to delete files associated with each FILE
1474 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
1477 If FILE is a libtool library, object or program, all the files associated
1478 with it are deleted. Otherwise, only FILE itself is deleted using RM."
1483 "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
1485 Compile a source file into a libtool library object.
1487 This mode accepts the following additional options:
1489 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
1490 -no-suppress do not suppress compiler output for multiple passes
1491 -prefer-pic try to building PIC objects only
1492 -prefer-non-pic try to building non-PIC objects only
1493 -shared do not build a \`.o' file suitable for static linking
1494 -static only build a \`.o' file suitable for static linking
1496 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
1497 from the given SOURCEFILE.
1499 The output file name is determined by removing the directory component from
1500 SOURCEFILE, then substituting the C source code suffix \`.c' with the
1501 library object suffix, \`.lo'."
1506 "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
1508 Automatically set library path, then run a program.
1510 This mode accepts the following additional options:
1512 -dlopen FILE add the directory containing FILE to the library path
1514 This mode sets the library path environment variable according to \`-dlopen'
1517 If any of the ARGS are libtool executable wrappers, then they are translated
1518 into their corresponding uninstalled binary, and any of their required library
1519 directories are added to the library path.
1521 Then, COMMAND is executed, with ARGS as arguments."
1526 "Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
1528 Complete the installation of libtool libraries.
1530 Each LIBDIR is a directory that contains libtool libraries.
1532 The commands that this mode executes may require superuser privileges. Use
1533 the \`--dry-run' option if you just want to see what would be executed."
1538 "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
1540 Install executables or libraries.
1542 INSTALL-COMMAND is the installation command. The first component should be
1543 either the \`install' or \`cp' program.
1545 The following components of INSTALL-COMMAND are treated specially:
1547 -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation
1549 The rest of the components are interpreted as arguments to that command (only
1550 BSD-compatible install options are recognized)."
1555 "Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
1557 Link object files or libraries together to form another library, or to
1558 create an executable program.
1560 LINK-COMMAND is a command using the C compiler that you would use to create
1561 a program from several object files.
1563 The following components of LINK-COMMAND are treated specially:
1565 -all-static do not do any dynamic linking at all
1566 -avoid-version do not add a version suffix if possible
1567 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
1568 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
1569 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
1570 -export-symbols SYMFILE
1571 try to export only the symbols listed in SYMFILE
1572 -export-symbols-regex REGEX
1573 try to export only the symbols matching REGEX
1574 -LLIBDIR search LIBDIR for required installed libraries
1575 -lNAME OUTPUT-FILE requires the installed library libNAME
1576 -module build a library that can dlopened
1577 -no-fast-install disable the fast-install mode
1578 -no-install link a not-installable executable
1579 -no-undefined declare that a library does not refer to external symbols
1580 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
1581 -objectlist FILE Use a list of object files found in FILE to specify objects
1582 -precious-files-regex REGEX
1583 don't remove output files matching REGEX
1584 -release RELEASE specify package release information
1585 -rpath LIBDIR the created library will eventually be installed in LIBDIR
1586 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
1587 -shared only do dynamic linking of libtool libraries
1588 -shrext SUFFIX override the standard shared library file extension
1589 -static do not do any dynamic linking of uninstalled libtool libraries
1590 -static-libtool-libs
1591 do not do any dynamic linking of libtool libraries
1592 -version-info CURRENT[:REVISION[:AGE]]
1593 specify library version info [each variable defaults to 0]
1594 -weak LIBNAME declare that the target provides the LIBNAME interface
1596 All other options (arguments beginning with \`-') are ignored.
1598 Every other argument is treated as a filename. Files ending in \`.la' are
1599 treated as uninstalled libtool libraries, other files are standard or library
1602 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
1603 only library objects (\`.lo' files) may be specified, and \`-rpath' is
1604 required, except when creating a convenience library.
1606 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
1607 using \`ar' and \`ranlib', or on Windows using \`lib'.
1609 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
1610 is created, otherwise an executable program is created."
1615 "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
1617 Remove libraries from an installation directory.
1619 RM is the name of the program to use to delete files associated with each FILE
1620 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
1623 If FILE is a libtool library, all the files associated with it are deleted.
1624 Otherwise, only FILE itself is deleted using RM."
1628 func_fatal_help "invalid operation mode \`$mode'"
1633 $ECHO "Try \`$progname --help' for more information about other modes."
1638 # Now that we've collected a possible --mode arg, show help if necessary
1639 $opt_help && func_mode_help
1642 # func_mode_execute arg...
1643 func_mode_execute ()
1646 # The first argument is the command name.
1649 func_fatal_help "you must specify a COMMAND"
1651 # Handle -dlopen flags immediately.
1652 for file in $execute_dlfiles; do
1654 || func_fatal_help "\`$file' is not a file"
1659 # Check to see that this really is a libtool archive.
1660 func_lalib_unsafe_p "$file" \
1661 || func_fatal_help "\`$lib' is not a valid libtool archive"
1663 # Read the libtool library.
1668 # Skip this library if it cannot be dlopened.
1669 if test -z "$dlname"; then
1670 # Warn if it was a shared library.
1671 test -n "$library_names" && \
1672 func_warning "\`$file' was not linked with \`-export-dynamic'"
1676 func_dirname "$file" "" "."
1677 dir="$func_dirname_result"
1679 if test -f "$dir/$objdir/$dlname"; then
1682 if test ! -f "$dir/$dlname"; then
1683 func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
1689 # Just add the directory containing the .lo file.
1690 func_dirname "$file" "" "."
1691 dir="$func_dirname_result"
1695 func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
1700 # Get the absolute pathname.
1701 absdir=`cd "$dir" && pwd`
1702 test -n "$absdir" && dir="$absdir"
1704 # Now add the directory to shlibpath_var.
1705 if eval "test -z \"\$$shlibpath_var\""; then
1706 eval "$shlibpath_var=\"\$dir\""
1708 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
1712 # This variable tells wrapper scripts just to set shlibpath_var
1713 # rather than running their programs.
1714 libtool_execute_magic="$magic"
1716 # Check if any of the arguments is a wrapper script.
1723 # Do a test to see if this is really a libtool program.
1724 if func_ltwrapper_script_p "$file"; then
1726 # Transform arg to wrapped name.
1727 file="$progdir/$program"
1728 elif func_ltwrapper_executable_p "$file"; then
1729 func_ltwrapper_scriptname "$file"
1730 func_source "$func_ltwrapper_scriptname_result"
1731 # Transform arg to wrapped name.
1732 file="$progdir/$program"
1736 # Quote arguments (to preserve shell metacharacters).
1737 func_quote_for_eval "$file"
1738 args="$args $func_quote_for_eval_result"
1741 if test "X$opt_dry_run" = Xfalse; then
1742 if test -n "$shlibpath_var"; then
1743 # Export the shlibpath_var.
1744 eval "export $shlibpath_var"
1747 # Restore saved environment variables
1748 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
1750 eval "if test \"\${save_$lt_var+set}\" = set; then
1751 $lt_var=\$save_$lt_var; export $lt_var
1757 # Now prepare to actually exec the command.
1758 exec_cmd="\$cmd$args"
1760 # Display what would be done.
1761 if test -n "$shlibpath_var"; then
1762 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
1763 $ECHO "export $shlibpath_var"
1770 test "$mode" = execute && func_mode_execute ${1+"$@"}
1773 # func_mode_finish arg...
1780 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
1783 libdirs="$libdirs $dir"
1786 for libdir in $libdirs; do
1787 if test -n "$finish_cmds"; then
1788 # Do each command in the finish commands.
1789 func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
1792 if test -n "$finish_eval"; then
1793 # Do the single finish_eval.
1794 eval cmds=\"$finish_eval\"
1795 $opt_dry_run || eval "$cmds" || admincmds="$admincmds
1801 # Exit here if they wanted silent mode.
1802 $opt_silent && exit $EXIT_SUCCESS
1804 $ECHO "X----------------------------------------------------------------------" | $Xsed
1805 $ECHO "Libraries have been installed in:"
1806 for libdir in $libdirs; do
1810 $ECHO "If you ever happen to want to link against installed libraries"
1811 $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
1812 $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
1813 $ECHO "flag during linking and do at least one of the following:"
1814 if test -n "$shlibpath_var"; then
1815 $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable"
1816 $ECHO " during execution"
1818 if test -n "$runpath_var"; then
1819 $ECHO " - add LIBDIR to the \`$runpath_var' environment variable"
1820 $ECHO " during linking"
1822 if test -n "$hardcode_libdir_flag_spec"; then
1824 eval flag=\"$hardcode_libdir_flag_spec\"
1826 $ECHO " - use the \`$flag' linker flag"
1828 if test -n "$admincmds"; then
1829 $ECHO " - have your system administrator run these commands:$admincmds"
1831 if test -f /etc/ld.so.conf; then
1832 $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
1836 $ECHO "See any operating system documentation about shared libraries for"
1838 solaris2.[6789]|solaris2.1[0-9])
1839 $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
1843 $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
1846 $ECHO "X----------------------------------------------------------------------" | $Xsed
1850 test "$mode" = finish && func_mode_finish ${1+"$@"}
1853 # func_mode_install arg...
1854 func_mode_install ()
1857 # There may be an optional sh(1) argument at the beginning of
1858 # install_prog (especially on Windows NT).
1859 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
1860 # Allow the use of GNU shtool's install command.
1861 $ECHO "X$nonopt" | $GREP shtool >/dev/null; then
1862 # Aesthetically quote it.
1863 func_quote_for_eval "$nonopt"
1864 install_prog="$func_quote_for_eval_result "
1872 # The real first argument should be the name of the installation program.
1873 # Aesthetically quote it.
1874 func_quote_for_eval "$arg"
1875 install_prog="$install_prog$func_quote_for_eval_result"
1877 # We need to accept at least all the BSD install flags.
1887 if test -n "$dest"; then
1888 files="$files $dest"
1896 case " $install_prog " in
1911 # If the previous option needed an argument, then skip it.
1912 if test -n "$prev"; then
1921 # Aesthetically quote the argument.
1922 func_quote_for_eval "$arg"
1923 install_prog="$install_prog $func_quote_for_eval_result"
1926 test -z "$install_prog" && \
1927 func_fatal_help "you must specify an install program"
1929 test -n "$prev" && \
1930 func_fatal_help "the \`$prev' option requires an argument"
1932 if test -z "$files"; then
1933 if test -z "$dest"; then
1934 func_fatal_help "no file or destination specified"
1936 func_fatal_help "you must specify a destination"
1940 # Strip any trailing slash from the destination.
1941 func_stripname '' '/' "$dest"
1942 dest=$func_stripname_result
1944 # Check to see that the destination is a directory.
1945 test -d "$dest" && isdir=yes
1946 if test "$isdir" = yes; then
1950 func_dirname_and_basename "$dest" "" "."
1951 destdir="$func_dirname_result"
1952 destname="$func_basename_result"
1954 # Not a directory, so check to see that there is only one file specified.
1955 set dummy $files; shift
1956 test "$#" -gt 1 && \
1957 func_fatal_help "\`$dest' is not a directory"
1960 [\\/]* | [A-Za-z]:[\\/]*) ;;
1962 for file in $files; do
1966 func_fatal_help "\`$destdir' must be an absolute directory name"
1973 # This variable tells wrapper scripts just to set variables rather
1974 # than running their programs.
1975 libtool_install_magic="$magic"
1980 for file in $files; do
1982 # Do each installation.
1985 # Do the static libraries later.
1986 staticlibs="$staticlibs $file"
1990 # Check to see that this really is a libtool archive.
1991 func_lalib_unsafe_p "$file" \
1992 || func_fatal_help "\`$file' is not a valid libtool archive"
1999 # Add the libdir to current_libdirs if it is the destination.
2000 if test "X$destdir" = "X$libdir"; then
2001 case "$current_libdirs " in
2003 *) current_libdirs="$current_libdirs $libdir" ;;
2006 # Note the libdir as a future libdir.
2007 case "$future_libdirs " in
2009 *) future_libdirs="$future_libdirs $libdir" ;;
2013 func_dirname "$file" "/" ""
2014 dir="$func_dirname_result"
2017 if test -n "$relink_command"; then
2018 # Determine the prefix the user has applied to our future dir.
2019 inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
2021 # Don't allow the user to place us outside of our expected
2022 # location b/c this prevents finding dependent libraries that
2023 # are installed to the same prefix.
2024 # At present, this check doesn't affect windows .dll's that
2025 # are installed into $libdir/../bin (currently, that works fine)
2026 # but it's something to keep an eye on.
2027 test "$inst_prefix_dir" = "$destdir" && \
2028 func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
2030 if test -n "$inst_prefix_dir"; then
2031 # Stick the inst_prefix_dir data into the link command.
2032 relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
2034 relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
2037 func_warning "relinking \`$file'"
2038 func_show_eval "$relink_command" \
2039 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
2042 # See the names of the shared library.
2043 set dummy $library_names; shift
2044 if test -n "$1"; then
2049 test -n "$relink_command" && srcname="$realname"T
2051 # Install the shared library and build the symlinks.
2052 func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
2056 cygwin* | mingw* | pw32*)
2064 if test -n "$tstripme" && test -n "$striplib"; then
2065 func_show_eval "$striplib $destdir/$realname" 'exit $?'
2068 if test "$#" -gt 0; then
2069 # Delete the old symlinks, and create new ones.
2070 # Try `ln -sf' first, because the `ln' binary might depend on
2071 # the symlink we replace! Solaris /bin/ln does not understand -f,
2072 # so we also need to try rm && ln -s.
2075 test "$linkname" != "$realname" \
2076 && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
2080 # Do each command in the postinstall commands.
2081 lib="$destdir/$realname"
2082 func_execute_cmds "$postinstall_cmds" 'exit $?'
2085 # Install the pseudo-library for information purposes.
2086 func_basename "$file"
2087 name="$func_basename_result"
2088 instname="$dir/$name"i
2089 func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
2091 # Maybe install the static library, too.
2092 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
2096 # Install (i.e. copy) a libtool object.
2098 # Figure out destination file name, if it wasn't already specified.
2099 if test -n "$destname"; then
2100 destfile="$destdir/$destname"
2102 func_basename "$file"
2103 destfile="$func_basename_result"
2104 destfile="$destdir/$destfile"
2107 # Deduce the name of the destination old-style object file.
2110 func_lo2o "$destfile"
2111 staticdest=$func_lo2o_result
2114 staticdest="$destfile"
2118 func_fatal_help "cannot copy a libtool object to \`$destfile'"
2122 # Install the libtool object if requested.
2123 test -n "$destfile" && \
2124 func_show_eval "$install_prog $file $destfile" 'exit $?'
2126 # Install the old object if enabled.
2127 if test "$build_old_libs" = yes; then
2128 # Deduce the name of the old-style object file.
2130 staticobj=$func_lo2o_result
2131 func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
2137 # Figure out destination file name, if it wasn't already specified.
2138 if test -n "$destname"; then
2139 destfile="$destdir/$destname"
2141 func_basename "$file"
2142 destfile="$func_basename_result"
2143 destfile="$destdir/$destfile"
2146 # If the file is missing, and there is a .exe on the end, strip it
2147 # because it is most likely a libtool script we actually want to
2152 if test ! -f "$file"; then
2153 func_stripname '' '.exe' "$file"
2154 file=$func_stripname_result
2160 # Do a test to see if this is really a libtool program.
2163 if func_ltwrapper_executable_p "$file"; then
2164 func_ltwrapper_scriptname "$file"
2165 wrapper=$func_ltwrapper_scriptname_result
2167 func_stripname '' '.exe' "$file"
2168 wrapper=$func_stripname_result
2175 if func_ltwrapper_script_p "$wrapper"; then
2179 func_source "$wrapper"
2181 # Check the variables that should have been set.
2182 test -z "$generated_by_libtool_version" && \
2183 func_fatal_error "invalid libtool wrapper script \`$wrapper'"
2186 for lib in $notinst_deplibs; do
2187 # Check to see that each library is installed.
2189 if test -f "$lib"; then
2192 libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
2193 if test -n "$libdir" && test ! -f "$libfile"; then
2194 func_warning "\`$lib' has not been installed in \`$libdir'"
2200 func_source "$wrapper"
2203 if test "$fast_install" = no && test -n "$relink_command"; then
2205 if test "$finalize" = yes; then
2206 tmpdir=`func_mktempdir`
2207 func_basename "$file$stripped_ext"
2208 file="$func_basename_result"
2209 outputname="$tmpdir/$file"
2210 # Replace the output file specification.
2211 relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
2214 func_quote_for_expand "$relink_command"
2215 eval "func_echo $func_quote_for_expand_result"
2217 if eval "$relink_command"; then :
2219 func_error "error: relink \`$file' with the above command before installing it"
2220 $opt_dry_run || ${RM}r "$tmpdir"
2225 func_warning "cannot relink \`$file'"
2229 # Install the binary that we compiled earlier.
2230 file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
2234 # remove .exe since cygwin /usr/bin/install will append another
2236 case $install_prog,$host in
2237 */usr/bin/install*,*cygwin*)
2238 case $file:$destfile in
2243 destfile=$destfile.exe
2246 func_stripname '' '.exe' "$destfile"
2247 destfile=$func_stripname_result
2252 func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
2253 $opt_dry_run || if test -n "$outputname"; then
2260 for file in $staticlibs; do
2261 func_basename "$file"
2262 name="$func_basename_result"
2264 # Set up the ranlib parameters.
2265 oldlib="$destdir/$name"
2267 func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
2269 if test -n "$stripme" && test -n "$old_striplib"; then
2270 func_show_eval "$old_striplib $oldlib" 'exit $?'
2273 # Do each command in the postinstall commands.
2274 func_execute_cmds "$old_postinstall_cmds" 'exit $?'
2277 test -n "$future_libdirs" && \
2278 func_warning "remember to run \`$progname --finish$future_libdirs'"
2280 if test -n "$current_libdirs"; then
2281 # Maybe just do a dry run.
2282 $opt_dry_run && current_libdirs=" -n$current_libdirs"
2283 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
2289 test "$mode" = install && func_mode_install ${1+"$@"}
2292 # func_generate_dlsyms outputname originator pic_p
2293 # Extract symbols from dlprefiles and create ${outputname}S.o with
2294 # a dlpreopen symbol table.
2295 func_generate_dlsyms ()
2301 my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
2304 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2305 if test -n "$NM" && test -n "$global_symbol_pipe"; then
2306 my_dlsyms="${my_outputname}S.c"
2308 func_error "not configured to extract global symbols from dlpreopened files"
2312 if test -n "$my_dlsyms"; then
2316 # Discover the nlist of each of the dlfiles.
2317 nlist="$output_objdir/${my_outputname}.nm"
2319 func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
2321 # Parse the name list into a source file.
2322 func_verbose "creating $output_objdir/$my_dlsyms"
2324 $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
2325 /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
2326 /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
2332 /* External symbol declarations for the compiler. */\
2335 if test "$dlself" = yes; then
2336 func_verbose "generating symbol list for \`$output'"
2338 $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
2340 # Add our own program objects to the symbol list.
2341 progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2342 for progfile in $progfiles; do
2343 func_verbose "extracting global C symbols from \`$progfile'"
2344 $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
2347 if test -n "$exclude_expsyms"; then
2349 eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
2350 eval '$MV "$nlist"T "$nlist"'
2354 if test -n "$export_symbols_regex"; then
2356 eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
2357 eval '$MV "$nlist"T "$nlist"'
2361 # Prepare the list of exported symbols
2362 if test -z "$export_symbols"; then
2363 export_symbols="$output_objdir/$outputname.exp"
2366 eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
2368 *cygwin* | *mingw* )
2369 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
2370 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
2376 eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
2377 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
2378 eval '$MV "$nlist"T "$nlist"'
2381 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
2382 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
2389 for dlprefile in $dlprefiles; do
2390 func_verbose "extracting global C symbols from \`$dlprefile'"
2391 func_basename "$dlprefile"
2392 name="$func_basename_result"
2394 eval '$ECHO ": $name " >> "$nlist"'
2395 eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
2400 # Make sure we have at least an empty file.
2401 test -f "$nlist" || : > "$nlist"
2403 if test -n "$exclude_expsyms"; then
2404 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
2405 $MV "$nlist"T "$nlist"
2408 # Try sorting and uniquifying the output.
2409 if $GREP -v "^: " < "$nlist" |
2410 if sort -k 3 </dev/null >/dev/null 2>&1; then
2415 uniq > "$nlist"S; then
2418 $GREP -v "^: " < "$nlist" > "$nlist"S
2421 if test -f "$nlist"S; then
2422 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
2424 $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
2427 $ECHO >> "$output_objdir/$my_dlsyms" "\
2429 /* The mapping between symbol names and symbols. */
2436 *cygwin* | *mingw* )
2437 $ECHO >> "$output_objdir/$my_dlsyms" "\
2438 /* DATA imports from DLLs on WIN32 con't be const, because
2439 runtime relocations are performed -- see ld's documentation
2440 on pseudo-relocs. */"
2443 echo >> "$output_objdir/$my_dlsyms" "\
2444 /* This system does not cope well with relocations in const data */"
2447 lt_dlsym_const=const ;;
2450 $ECHO >> "$output_objdir/$my_dlsyms" "\
2451 extern $lt_dlsym_const lt_dlsymlist
2452 lt_${my_prefix}_LTX_preloaded_symbols[];
2453 $lt_dlsym_const lt_dlsymlist
2454 lt_${my_prefix}_LTX_preloaded_symbols[] =
2456 { \"$my_originator\", (void *) 0 },"
2458 case $need_lib_prefix in
2460 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
2463 eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
2466 $ECHO >> "$output_objdir/$my_dlsyms" "\
2470 /* This works around a problem in FreeBSD linker */
2471 #ifdef FREEBSD_WORKAROUND
2472 static const void *lt_preloaded_setup() {
2473 return lt_${my_prefix}_LTX_preloaded_symbols;
2483 pic_flag_for_symtable=
2484 case "$compile_command " in
2488 # compiling the symbol table file with pic_flag works around
2489 # a FreeBSD bug that causes programs to crash when -lm is
2490 # linked before any other PIC object. But we must not use
2491 # pic_flag when linking with -static. The problem exists in
2492 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
2493 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
2494 pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
2496 pic_flag_for_symtable=" $pic_flag" ;;
2498 if test "X$my_pic_p" != Xno; then
2499 pic_flag_for_symtable=" $pic_flag"
2506 for arg in $LTCFLAGS; do
2508 -pie | -fpie | -fPIE) ;;
2509 *) symtab_cflags="$symtab_cflags $arg" ;;
2513 # Now compile the dynamic symbol file.
2514 func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
2516 # Clean up the generated files.
2517 func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
2519 # Transform the symbol file into the correct name.
2520 symfileobj="$output_objdir/${my_outputname}S.$objext"
2522 *cygwin* | *mingw* )
2523 if test -f "$output_objdir/$my_outputname.def"; then
2524 compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
2525 finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
2527 compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
2528 finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
2532 compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
2533 finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
2538 func_fatal_error "unknown suffix for \`$my_dlsyms'"
2542 # We keep going just in case the user didn't refer to
2543 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
2544 # really was required.
2546 # Nullify the symbol file.
2547 compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
2548 finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
2552 # func_win32_libid arg
2553 # return the library type of file 'arg'
2555 # Need a lot of goo to handle *both* DLLs and import libs
2556 # Has to be a shell function in order to 'eat' the argument
2557 # that is supplied when $file_magic_command is called.
2561 win32_libid_type="unknown"
2562 win32_fileres=`file -L $1 2>/dev/null`
2563 case $win32_fileres in
2564 *ar\ archive\ import\ library*) # definitely import
2565 win32_libid_type="x86 archive import"
2567 *ar\ archive*) # could be an import, or static
2568 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
2569 $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
2570 win32_nmres=`eval $NM -f posix -A $1 |
2579 case $win32_nmres in
2580 import*) win32_libid_type="x86 archive import";;
2581 *) win32_libid_type="x86 archive static";;
2586 win32_libid_type="x86 DLL"
2588 *executable*) # but shell scripts are "executable" too...
2589 case $win32_fileres in
2590 *MS\ Windows\ PE\ Intel*)
2591 win32_libid_type="x86 DLL"
2596 $ECHO "$win32_libid_type"
2601 # func_extract_an_archive dir oldlib
2602 func_extract_an_archive ()
2605 f_ex_an_ar_dir="$1"; shift
2606 f_ex_an_ar_oldlib="$1"
2607 func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
2608 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
2611 func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
2616 # func_extract_archives gentop oldlib ...
2617 func_extract_archives ()
2620 my_gentop="$1"; shift
2621 my_oldlibs=${1+"$@"}
2627 for my_xlib in $my_oldlibs; do
2628 # Extract the objects.
2630 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
2631 *) my_xabs=`pwd`"/$my_xlib" ;;
2633 func_basename "$my_xlib"
2634 my_xlib="$func_basename_result"
2637 case " $extracted_archives " in
2639 func_arith $extracted_serial + 1
2640 extracted_serial=$func_arith_result
2641 my_xlib_u=lt$extracted_serial-$my_xlib ;;
2645 extracted_archives="$extracted_archives $my_xlib_u"
2646 my_xdir="$my_gentop/$my_xlib_u"
2648 func_mkdir_p "$my_xdir"
2652 func_verbose "Extracting $my_xabs"
2653 # Do not bother doing anything if just a dry run
2655 darwin_orig_dir=`pwd`
2656 cd $my_xdir || exit $?
2657 darwin_archive=$my_xabs
2659 darwin_base_archive=`basename "$darwin_archive"`
2660 darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
2661 if test -n "$darwin_arches"; then
2662 darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
2664 func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
2665 for darwin_arch in $darwin_arches ; do
2666 func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
2667 $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
2668 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
2669 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
2671 $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
2672 done # $darwin_arches
2673 ## Okay now we've a bunch of thin objects, gotta fatten them up :)
2674 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
2677 for darwin_file in $darwin_filelist; do
2678 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
2679 $LIPO -create -output "$darwin_file" $darwin_files
2680 done # $darwin_filelist
2682 cd "$darwin_orig_dir"
2685 func_extract_an_archive "$my_xdir" "$my_xabs"
2690 func_extract_an_archive "$my_xdir" "$my_xabs"
2693 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
2696 func_extract_archives_result="$my_oldobjs"
2701 # func_emit_wrapper arg
2703 # emit a libtool wrapper script on stdout
2704 # don't directly open a file because we may want to
2705 # incorporate the script contents within a cygwin/mingw
2706 # wrapper executable. Must ONLY be called from within
2707 # func_mode_link because it depends on a number of variable
2710 # arg is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
2711 # variable will take. If 'yes', then the emitted script
2712 # will assume that the directory in which it is stored is
2713 # the '.lib' directory. This is a cygwin/mingw-specific
2715 func_emit_wrapper ()
2717 func_emit_wrapper_arg1=no
2718 if test -n "$1" ; then
2719 func_emit_wrapper_arg1=$1
2725 # $output - temporary wrapper script for $objdir/$outputname
2726 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
2728 # The $output program cannot be directly executed until all the libtool
2729 # libraries that it depends on are installed.
2731 # This wrapper script should never be moved out of the build directory.
2732 # If it is, it will not operate correctly.
2734 # Sed substitution that helps us do robust quoting. It backslashifies
2735 # metacharacters that are still active within double-quoted strings.
2736 Xsed='${SED} -e 1s/^X//'
2737 sed_quote_subst='$sed_quote_subst'
2739 # Be Bourne compatible
2740 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
2743 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
2744 # is contrary to our usage. Disable this feature.
2745 alias -g '\${1+\"\$@\"}'='\"\$@\"'
2746 setopt NO_GLOB_SUBST
2748 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
2750 BIN_SH=xpg4; export BIN_SH # for Tru64
2751 DUALCASE=1; export DUALCASE # for MKS sh
2753 # The HP-UX ksh and POSIX shell print the target directory to stdout
2755 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
2757 relink_command=\"$relink_command\"
2759 # This environment variable determines our operation mode.
2760 if test \"\$libtool_install_magic\" = \"$magic\"; then
2761 # install mode needs the following variables:
2762 generated_by_libtool_version='$macro_version'
2763 notinst_deplibs='$notinst_deplibs'
2765 # When we are sourced in execute mode, \$file and \$ECHO are already set.
2766 if test \"\$libtool_execute_magic\" != \"$magic\"; then
2769 # Make sure echo works.
2770 if test \"X\$1\" = X--no-reexec; then
2771 # Discard the --no-reexec flag, and continue.
2773 elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
2774 # Yippee, \$ECHO works!
2777 # Restart under the correct shell, and then maybe \$ECHO will work.
2778 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
2784 # Find the directory that this script lives in.
2785 thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
2786 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
2788 # Follow symbolic links until we get to the real thisdir.
2789 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
2790 while test -n \"\$file\"; do
2791 destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
2793 # If there was a directory component, then change thisdir.
2794 if test \"x\$destdir\" != \"x\$file\"; then
2795 case \"\$destdir\" in
2796 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
2797 *) thisdir=\"\$thisdir/\$destdir\" ;;
2801 file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
2802 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
2805 # Usually 'no', except on cygwin/mingw when embedded into
2807 WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
2808 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
2809 # special case for '.'
2810 if test \"\$thisdir\" = \".\"; then
2813 # remove .libs from thisdir
2814 case \"\$thisdir\" in
2815 *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
2816 $objdir ) thisdir=. ;;
2820 # Try to get the absolute directory name.
2821 absdir=\`cd \"\$thisdir\" && pwd\`
2822 test -n \"\$absdir\" && thisdir=\"\$absdir\"
2825 if test "$fast_install" = yes; then
2827 program=lt-'$outputname'$exeext
2828 progdir=\"\$thisdir/$objdir\"
2830 if test ! -f \"\$progdir/\$program\" ||
2831 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
2832 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
2834 file=\"\$\$-\$program\"
2836 if test ! -d \"\$progdir\"; then
2837 $MKDIR \"\$progdir\"
2839 $RM \"\$progdir/\$file\"
2844 # relink executable if necessary
2845 if test -n \"\$relink_command\"; then
2846 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
2848 $ECHO \"\$relink_command_output\" >&2
2849 $RM \"\$progdir/\$file\"
2854 $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
2855 { $RM \"\$progdir/\$program\";
2856 $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
2857 $RM \"\$progdir/\$file\"
2861 program='$outputname'
2862 progdir=\"\$thisdir/$objdir\"
2868 if test -f \"\$progdir/\$program\"; then"
2870 # Export our shlibpath_var if we have one.
2871 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
2873 # Add our own library path to $shlibpath_var
2874 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
2876 # Some systems cannot cope with colon-terminated $shlibpath_var
2877 # The second colon is a workaround for a bug in BeOS R4 sed
2878 $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
2880 export $shlibpath_var
2884 # fixup the dll searchpath if we need to.
2885 if test -n "$dllsearchpath"; then
2887 # Add the dll search path components to the executable PATH
2888 PATH=$dllsearchpath:\$PATH
2893 if test \"\$libtool_execute_magic\" != \"$magic\"; then
2894 # Run the actual program with our arguments.
2897 # Backslashes separate directories on plain windows
2898 *-*-mingw | *-*-os2*)
2900 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
2906 exec \"\$progdir/\$program\" \${1+\"\$@\"}
2911 \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
2915 # The program doesn't exist.
2916 \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
2917 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
2918 $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
2924 # end: func_emit_wrapper
2926 # func_emit_cwrapperexe_src
2927 # emit the source code for a wrapper executable on stdout
2928 # Must ONLY be called from within func_mode_link because
2929 # it depends on a number of variable set therein.
2930 func_emit_cwrapperexe_src ()
2934 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
2935 Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
2937 The $output program cannot be directly executed until all the libtool
2938 libraries that it depends on are installed.
2940 This wrapper executable should never be moved out of the build directory.
2941 If it is, it will not operate correctly.
2943 Currently, it simply execs the wrapper *script* "$SHELL $output",
2944 but could eventually absorb all of the scripts functionality and
2945 exec $objdir/$outputname directly.
2952 # include <direct.h>
2953 # include <process.h>
2955 # define setmode _setmode
2957 # include <unistd.h>
2958 # include <stdint.h>
2970 #include <sys/stat.h>
2972 #if defined(PATH_MAX)
2973 # define LT_PATHMAX PATH_MAX
2974 #elif defined(MAXPATHLEN)
2975 # define LT_PATHMAX MAXPATHLEN
2977 # define LT_PATHMAX 1024
2988 # define S_IXUSR _S_IEXEC
2990 # ifndef _INTPTR_T_DEFINED
2991 # define intptr_t int
2995 #ifndef DIR_SEPARATOR
2996 # define DIR_SEPARATOR '/'
2997 # define PATH_SEPARATOR ':'
3000 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
3002 # define HAVE_DOS_BASED_FILE_SYSTEM
3003 # define FOPEN_WB "wb"
3004 # ifndef DIR_SEPARATOR_2
3005 # define DIR_SEPARATOR_2 '\\'
3007 # ifndef PATH_SEPARATOR_2
3008 # define PATH_SEPARATOR_2 ';'
3012 #ifndef DIR_SEPARATOR_2
3013 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
3014 #else /* DIR_SEPARATOR_2 */
3015 # define IS_DIR_SEPARATOR(ch) \
3016 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
3017 #endif /* DIR_SEPARATOR_2 */
3019 #ifndef PATH_SEPARATOR_2
3020 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
3021 #else /* PATH_SEPARATOR_2 */
3022 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
3023 #endif /* PATH_SEPARATOR_2 */
3026 # define FOPEN_WB "wb"
3030 # define FOPEN_WB "w"
3033 # define _O_BINARY 0
3036 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
3037 #define XFREE(stale) do { \
3038 if (stale) { free ((void *) stale); stale = 0; } \
3041 #undef LTWRAPPER_DEBUGPRINTF
3042 #if defined DEBUGWRAPPER
3043 # define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
3045 ltwrapper_debugprintf (const char *fmt, ...)
3048 va_start (args, fmt);
3049 (void) vfprintf (stderr, fmt, args);
3053 # define LTWRAPPER_DEBUGPRINTF(args)
3056 const char *program_name = NULL;
3058 void *xmalloc (size_t num);
3059 char *xstrdup (const char *string);
3060 const char *base_name (const char *name);
3061 char *find_executable (const char *wrapper);
3062 char *chase_symlinks (const char *pathspec);
3063 int make_executable (const char *path);
3064 int check_executable (const char *path);
3065 char *strendzap (char *str, const char *pat);
3066 void lt_fatal (const char *message, ...);
3068 static const char *script_text =
3071 func_emit_wrapper yes |
3072 $SED -e 's/\([\\"]\)/\\\1/g' \
3073 -e 's/^/ "/' -e 's/$/\\n"/'
3077 const char * MAGIC_EXE = "$magic_exe";
3080 main (int argc, char *argv[])
3084 char *actual_cwrapper_path;
3085 char *shwrapper_name;
3086 intptr_t rval = 127;
3089 const char *dumpscript_opt = "--lt-dump-script";
3092 program_name = (char *) xstrdup (base_name (argv[0]));
3093 LTWRAPPER_DEBUGPRINTF (("(main) argv[0] : %s\n", argv[0]));
3094 LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
3096 /* very simple arg parsing; don't want to rely on getopt */
3097 for (i = 1; i < argc; i++)
3099 if (strcmp (argv[i], dumpscript_opt) == 0)
3103 *mingw* | *cygwin* )
3104 # make stdout use "unix" line endings
3105 echo " setmode(1,_O_BINARY);"
3110 printf ("%s", script_text);
3115 newargz = XMALLOC (char *, argc + 2);
3118 if test -n "$TARGETSHELL" ; then
3119 # no path translation at all
3120 lt_newargv0=$TARGETSHELL
3124 # awkward: cmd appends spaces to result
3125 lt_sed_strip_trailing_spaces="s/[ ]*\$//"
3126 lt_newargv0=`( cmd //c echo $SHELL | $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo $SHELL`
3127 case $lt_newargv0 in
3129 *) lt_newargv0=$lt_newargv0.exe ;;
3132 * ) lt_newargv0=$SHELL ;;
3137 newargz[0] = (char *) xstrdup ("$lt_newargv0");
3141 tmp_pathspec = find_executable (argv[0]);
3142 if (tmp_pathspec == NULL)
3143 lt_fatal ("Couldn't find %s", argv[0]);
3144 LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
3147 actual_cwrapper_path = chase_symlinks (tmp_pathspec);
3148 LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
3149 actual_cwrapper_path));
3150 XFREE (tmp_pathspec);
3152 shwrapper_name = (char *) xstrdup (base_name (actual_cwrapper_path));
3153 strendzap (actual_cwrapper_path, shwrapper_name);
3155 /* shwrapper_name transforms */
3156 strendzap (shwrapper_name, ".exe");
3157 tmp_pathspec = XMALLOC (char, (strlen (shwrapper_name) +
3158 strlen ("_ltshwrapperTMP") + 1));
3159 strcpy (tmp_pathspec, shwrapper_name);
3160 strcat (tmp_pathspec, "_ltshwrapperTMP");
3161 XFREE (shwrapper_name);
3162 shwrapper_name = tmp_pathspec;
3164 LTWRAPPER_DEBUGPRINTF (("(main) libtool shell wrapper name: %s\n",
3170 XMALLOC (char, (strlen (actual_cwrapper_path) +
3171 strlen ("$objdir") + 1 + strlen (shwrapper_name) + 1));
3172 strcpy (newargz[1], actual_cwrapper_path);
3173 strcat (newargz[1], "$objdir");
3174 strcat (newargz[1], "/");
3175 strcat (newargz[1], shwrapper_name);
3184 while ((p = strchr (newargz[1], '\\')) != NULL)
3194 XFREE (shwrapper_name);
3195 XFREE (actual_cwrapper_path);
3197 /* always write in binary mode */
3198 if ((shwrapper = fopen (newargz[1], FOPEN_WB)) == 0)
3200 lt_fatal ("Could not open %s for writing", newargz[1]);
3202 fprintf (shwrapper, "%s", script_text);
3205 make_executable (newargz[1]);
3207 for (i = 1; i < argc; i++)
3208 newargz[i + 1] = xstrdup (argv[i]);
3209 newargz[argc + 1] = NULL;
3211 for (i = 0; i < argc + 1; i++)
3213 LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, newargz[i]));
3221 /* execv doesn't actually work on mingw as expected on unix */
3222 rval = _spawnv (_P_WAIT, "$lt_newargv0", (const char * const *) newargz);
3225 /* failed to start process */
3226 LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"$lt_newargv0\": errno = %d\n", errno));
3235 execv ("$lt_newargv0", newargz);
3236 return rval; /* =127, but avoids unused variable warning */
3245 xmalloc (size_t num)
3247 void *p = (void *) malloc (num);
3249 lt_fatal ("Memory exhausted");
3255 xstrdup (const char *string)
3257 return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
3262 base_name (const char *name)
3266 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
3267 /* Skip over the disk name in MSDOS pathnames. */
3268 if (isalpha ((unsigned char) name[0]) && name[1] == ':')
3272 for (base = name; *name; name++)
3273 if (IS_DIR_SEPARATOR (*name))
3279 check_executable (const char *path)
3283 LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n",
3284 path ? (*path ? path : "EMPTY!") : "NULL!"));
3285 if ((!path) || (!*path))
3288 if ((stat (path, &st) >= 0)
3289 && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
3296 make_executable (const char *path)
3301 LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n",
3302 path ? (*path ? path : "EMPTY!") : "NULL!"));
3303 if ((!path) || (!*path))
3306 if (stat (path, &st) >= 0)
3308 rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
3313 /* Searches for the full path of the wrapper. Returns
3314 newly allocated full path name if found, NULL otherwise
3315 Does not chase symlinks, even on platforms that support them.
3318 find_executable (const char *wrapper)
3323 /* static buffer for getcwd */
3324 char tmp[LT_PATHMAX + 1];
3328 LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n",
3329 wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
3331 if ((wrapper == NULL) || (*wrapper == '\0'))
3334 /* Absolute path? */
3335 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
3336 if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
3338 concat_name = xstrdup (wrapper);
3339 if (check_executable (concat_name))
3341 XFREE (concat_name);
3346 if (IS_DIR_SEPARATOR (wrapper[0]))
3348 concat_name = xstrdup (wrapper);
3349 if (check_executable (concat_name))
3351 XFREE (concat_name);
3353 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
3357 for (p = wrapper; *p; p++)
3365 /* no slashes; search PATH */
3366 const char *path = getenv ("PATH");
3369 for (p = path; *p; p = p_next)
3373 for (q = p; *q; q++)
3374 if (IS_PATH_SEPARATOR (*q))
3377 p_next = (*q == '\0' ? q : q + 1);
3380 /* empty path: current directory */
3381 if (getcwd (tmp, LT_PATHMAX) == NULL)
3382 lt_fatal ("getcwd failed");
3383 tmp_len = strlen (tmp);
3385 XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
3386 memcpy (concat_name, tmp, tmp_len);
3387 concat_name[tmp_len] = '/';
3388 strcpy (concat_name + tmp_len + 1, wrapper);
3393 XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
3394 memcpy (concat_name, p, p_len);
3395 concat_name[p_len] = '/';
3396 strcpy (concat_name + p_len + 1, wrapper);
3398 if (check_executable (concat_name))
3400 XFREE (concat_name);
3403 /* not found in PATH; assume curdir */
3405 /* Relative path | not found in path: prepend cwd */
3406 if (getcwd (tmp, LT_PATHMAX) == NULL)
3407 lt_fatal ("getcwd failed");
3408 tmp_len = strlen (tmp);
3409 concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
3410 memcpy (concat_name, tmp, tmp_len);
3411 concat_name[tmp_len] = '/';
3412 strcpy (concat_name + tmp_len + 1, wrapper);
3414 if (check_executable (concat_name))
3416 XFREE (concat_name);
3421 chase_symlinks (const char *pathspec)
3424 return xstrdup (pathspec);
3426 char buf[LT_PATHMAX];
3428 char *tmp_pathspec = xstrdup (pathspec);
3430 int has_symlinks = 0;
3431 while (strlen (tmp_pathspec) && !has_symlinks)
3433 LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
3435 if (lstat (tmp_pathspec, &s) == 0)
3437 if (S_ISLNK (s.st_mode) != 0)
3443 /* search backwards for last DIR_SEPARATOR */
3444 p = tmp_pathspec + strlen (tmp_pathspec) - 1;
3445 while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
3447 if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
3449 /* no more DIR_SEPARATORS left */
3456 char *errstr = strerror (errno);
3457 lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
3460 XFREE (tmp_pathspec);
3464 return xstrdup (pathspec);
3467 tmp_pathspec = realpath (pathspec, buf);
3468 if (tmp_pathspec == 0)
3470 lt_fatal ("Could not follow symlinks for %s", pathspec);
3472 return xstrdup (tmp_pathspec);
3477 strendzap (char *str, const char *pat)
3481 assert (str != NULL);
3482 assert (pat != NULL);
3485 patlen = strlen (pat);
3489 str += len - patlen;
3490 if (strcmp (str, pat) == 0)
3497 lt_error_core (int exit_status, const char *mode,
3498 const char *message, va_list ap)
3500 fprintf (stderr, "%s: %s: ", program_name, mode);
3501 vfprintf (stderr, message, ap);
3502 fprintf (stderr, ".\n");
3504 if (exit_status >= 0)
3509 lt_fatal (const char *message, ...)
3512 va_start (ap, message);
3513 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
3518 # end: func_emit_cwrapperexe_src
3520 # func_mode_link arg...
3525 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
3526 # It is impossible to link a dll without this setting, and
3527 # we shouldn't force the makefile maintainer to figure out
3528 # which system we are compiling for in order to pass an extra
3529 # flag for every libtool invocation.
3530 # allow_undefined=no
3532 # FIXME: Unfortunately, there are problems with the above when trying
3533 # to make a dll which has undefined symbols, in which case not
3534 # even a static library is built. For now, we need to specify
3535 # -no-undefined on the libtool link line when we can be certain
3536 # that all symbols are satisfied, otherwise we get a static library.
3543 libtool_args=$nonopt
3544 base_compile="$nonopt $@"
3545 compile_command=$nonopt
3546 finalize_command=$nonopt
3559 lib_search_path=`pwd`
3561 new_inherited_linker_flags=
3569 export_symbols_regex=
3577 precious_files_regex=
3578 prefer_static_libs=no
3591 single_module="${wl}-single_module"
3592 func_infer_tag $base_compile
3594 # We need to know -static, to get the right output filenames.
3599 test "$build_libtool_libs" != yes && \
3600 func_fatal_configuration "can not build a shared library"
3604 -all-static | -static | -static-libtool-libs)
3607 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
3608 func_warning "complete static linking is impossible in this configuration"
3610 if test -n "$link_static_flag"; then
3611 dlopen_self=$dlopen_self_static
3613 prefer_static_libs=yes
3616 if test -z "$pic_flag" && test -n "$link_static_flag"; then
3617 dlopen_self=$dlopen_self_static
3619 prefer_static_libs=built
3621 -static-libtool-libs)
3622 if test -z "$pic_flag" && test -n "$link_static_flag"; then
3623 dlopen_self=$dlopen_self_static
3625 prefer_static_libs=yes
3628 build_libtool_libs=no
3635 # See if our shared archives depend on static archives.
3636 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
3638 # Go through the arguments, transforming them on the way.
3639 while test "$#" -gt 0; do
3642 func_quote_for_eval "$arg"
3643 qarg=$func_quote_for_eval_unquoted_result
3644 func_append libtool_args " $func_quote_for_eval_result"
3646 # If the previous option needs an argument, assign it.
3647 if test -n "$prev"; then
3650 func_append compile_command " @OUTPUT@"
3651 func_append finalize_command " @OUTPUT@"
3657 if test "$preload" = no; then
3658 # Add the symbol object into the linking commands.
3659 func_append compile_command " @SYMFILE@"
3660 func_append finalize_command " @SYMFILE@"
3664 *.la | *.lo) ;; # We handle these cases below.
3666 if test "$dlself" = no; then
3674 if test "$prev" = dlprefiles; then
3676 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
3686 if test "$prev" = dlfiles; then
3687 dlfiles="$dlfiles $arg"
3689 dlprefiles="$dlprefiles $arg"
3697 export_symbols="$arg"
3699 || func_fatal_error "symbol file \`$arg' does not exist"
3704 export_symbols_regex="$arg"
3712 *" $qarg.ltframework "*) ;;
3713 *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
3722 inst_prefix_dir="$arg"
3727 if test -f "$arg"; then
3730 for fil in `cat "$save_arg"`
3732 # moreargs="$moreargs $fil"
3734 # A libtool-controlled object.
3736 # Check to see that this really is a libtool object.
3737 if func_lalib_unsafe_p "$arg"; then
3744 if test -z "$pic_object" ||
3745 test -z "$non_pic_object" ||
3746 test "$pic_object" = none &&
3747 test "$non_pic_object" = none; then
3748 func_fatal_error "cannot find name of object for \`$arg'"
3751 # Extract subdirectory from the argument.
3752 func_dirname "$arg" "/" ""
3753 xdir="$func_dirname_result"
3755 if test "$pic_object" != none; then
3756 # Prepend the subdirectory the object is found in.
3757 pic_object="$xdir$pic_object"
3759 if test "$prev" = dlfiles; then
3760 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
3761 dlfiles="$dlfiles $pic_object"
3765 # If libtool objects are unsupported, then we need to preload.
3770 # CHECK ME: I think I busted this. -Ossama
3771 if test "$prev" = dlprefiles; then
3772 # Preload the old-style object.
3773 dlprefiles="$dlprefiles $pic_object"
3778 func_append libobjs " $pic_object"
3783 if test "$non_pic_object" != none; then
3784 # Prepend the subdirectory the object is found in.
3785 non_pic_object="$xdir$non_pic_object"
3787 # A standard non-PIC object
3788 func_append non_pic_objects " $non_pic_object"
3789 if test -z "$pic_object" || test "$pic_object" = none ; then
3790 arg="$non_pic_object"
3793 # If the PIC object exists, use it instead.
3794 # $xdir was prepended to $pic_object above.
3795 non_pic_object="$pic_object"
3796 func_append non_pic_objects " $non_pic_object"
3799 # Only an error if not doing a dry-run.
3800 if $opt_dry_run; then
3801 # Extract subdirectory from the argument.
3802 func_dirname "$arg" "/" ""
3803 xdir="$func_dirname_result"
3806 pic_object=$xdir$objdir/$func_lo2o_result
3807 non_pic_object=$xdir$func_lo2o_result
3808 func_append libobjs " $pic_object"
3809 func_append non_pic_objects " $non_pic_object"
3811 func_fatal_error "\`$arg' is not a valid libtool object"
3816 func_fatal_error "link input file \`$arg' does not exist"
3823 precious_files_regex="$arg"
3833 # We need an absolute path.
3835 [\\/]* | [A-Za-z]:[\\/]*) ;;
3837 func_fatal_error "only absolute run-paths are allowed"
3840 if test "$prev" = rpath; then
3843 *) rpath="$rpath $arg" ;;
3848 *) xrpath="$xrpath $arg" ;;
3860 weak_libs="$weak_libs $arg"
3865 linker_flags="$linker_flags $qarg"
3866 compiler_flags="$compiler_flags $qarg"
3868 func_append compile_command " $qarg"
3869 func_append finalize_command " $qarg"
3873 compiler_flags="$compiler_flags $qarg"
3875 func_append compile_command " $qarg"
3876 func_append finalize_command " $qarg"
3880 linker_flags="$linker_flags $qarg"
3881 compiler_flags="$compiler_flags $wl$qarg"
3883 func_append compile_command " $wl$qarg"
3884 func_append finalize_command " $wl$qarg"
3888 eval "$prev=\"\$arg\""
3893 fi # test -n "$prev"
3899 if test -n "$link_static_flag"; then
3900 # See comment for -static flag below, for more details.
3901 func_append compile_command " $link_static_flag"
3902 func_append finalize_command " $link_static_flag"
3908 # FIXME: remove this flag sometime in the future.
3909 func_fatal_error "\`-allow-undefined' must not be used because it is the default"
3932 -export-symbols | -export-symbols-regex)
3933 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3934 func_fatal_error "more than one -exported-symbols argument is not allowed"
3936 if test "X$arg" = "X-export-symbols"; then
3954 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
3955 # so, if we see these flags be careful not to treat them like -L
3957 case $with_gcc/$host in
3958 no/*-*-irix* | /*-*-irix*)
3959 func_append compile_command " $arg"
3960 func_append finalize_command " $arg"
3967 func_stripname '-L' '' "$arg"
3968 dir=$func_stripname_result
3969 # We need an absolute path.
3971 [\\/]* | [A-Za-z]:[\\/]*) ;;
3973 absdir=`cd "$dir" && pwd`
3974 test -z "$absdir" && \
3975 func_fatal_error "cannot determine absolute directory name of \`$dir'"
3982 deplibs="$deplibs -L$dir"
3983 lib_search_path="$lib_search_path $dir"
3987 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
3988 testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
3989 case :$dllsearchpath: in
3991 *) dllsearchpath="$dllsearchpath:$dir";;
3993 case :$dllsearchpath: in
3994 *":$testbindir:"*) ;;
3995 *) dllsearchpath="$dllsearchpath:$testbindir";;
4003 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
4005 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
4006 # These systems don't actually have a C or math library (as such)
4010 # These systems don't actually have a C library (as such)
4011 test "X$arg" = "X-lc" && continue
4013 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
4014 # Do not include libc due to us having libc/libc_r.
4015 test "X$arg" = "X-lc" && continue
4017 *-*-rhapsody* | *-*-darwin1.[012])
4018 # Rhapsody C and math libraries are in the System framework
4019 deplibs="$deplibs System.ltframework"
4022 *-*-sco3.2v5* | *-*-sco5v6*)
4023 # Causes problems with __ctype
4024 test "X$arg" = "X-lc" && continue
4026 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
4027 # Compiler inserts libc in the correct place for threads to work
4028 test "X$arg" = "X-lc" && continue
4031 elif test "X$arg" = "X-lc_r"; then
4033 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
4034 # Do not include libc_r directly, use -pthread flag.
4039 deplibs="$deplibs $arg"
4048 # Tru64 UNIX uses -model [arg] to determine the layout of C++
4049 # classes, name mangling, and exception handling.
4050 # Darwin uses the -arch flag to determine output architecture.
4051 -model|-arch|-isysroot)
4052 compiler_flags="$compiler_flags $arg"
4053 func_append compile_command " $arg"
4054 func_append finalize_command " $arg"
4059 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
4060 compiler_flags="$compiler_flags $arg"
4061 func_append compile_command " $arg"
4062 func_append finalize_command " $arg"
4063 case "$new_inherited_linker_flags " in
4065 * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
4071 single_module="${wl}-multi_module"
4082 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
4083 # The PATH hackery in wrapper scripts is required on Windows
4084 # and Darwin in order for the loader to find any dlls it needs.
4085 func_warning "\`-no-install' is ignored for $host"
4086 func_warning "assuming \`-no-fast-install' instead"
4089 *) no_install=yes ;;
4106 -precious-files-regex)
4127 func_stripname '-R' '' "$arg"
4128 dir=$func_stripname_result
4129 # We need an absolute path.
4131 [\\/]* | [A-Za-z]:[\\/]*) ;;
4133 func_fatal_error "only absolute run-paths are allowed"
4138 *) xrpath="$xrpath $dir" ;;
4144 # The effects of -shared are defined in a previous loop.
4153 -static | -static-libtool-libs)
4154 # The effects of -static are defined in a previous loop.
4155 # We used to do the same as -all-static on platforms that
4156 # didn't have a PIC flag, but the assumption that the effects
4157 # would be equivalent was wrong. It would break on at least
4158 # Digital Unix and AIX.
4184 func_stripname '-Wc,' '' "$arg"
4185 args=$func_stripname_result
4187 save_ifs="$IFS"; IFS=','
4188 for flag in $args; do
4190 func_quote_for_eval "$flag"
4191 arg="$arg $wl$func_quote_for_eval_result"
4192 compiler_flags="$compiler_flags $func_quote_for_eval_result"
4195 func_stripname ' ' '' "$arg"
4196 arg=$func_stripname_result
4200 func_stripname '-Wl,' '' "$arg"
4201 args=$func_stripname_result
4203 save_ifs="$IFS"; IFS=','
4204 for flag in $args; do
4206 func_quote_for_eval "$flag"
4207 arg="$arg $wl$func_quote_for_eval_result"
4208 compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
4209 linker_flags="$linker_flags $func_quote_for_eval_result"
4212 func_stripname ' ' '' "$arg"
4213 arg=$func_stripname_result
4233 func_quote_for_eval "$arg"
4234 arg="$func_quote_for_eval_result"
4237 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
4238 # -r[0-9][0-9]* specifies the processor on the SGI compiler
4239 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
4240 # +DA*, +DD* enable 64-bit mode on the HP compiler
4241 # -q* pass through compiler args for the IBM compiler
4242 # -m*, -t[45]*, -txscale* pass through architecture-specific
4243 # compiler args for GCC
4244 # -F/path gives path to uninstalled frameworks, gcc on darwin
4245 # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
4246 # @file GCC response files
4247 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
4248 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
4249 func_quote_for_eval "$arg"
4250 arg="$func_quote_for_eval_result"
4251 func_append compile_command " $arg"
4252 func_append finalize_command " $arg"
4253 compiler_flags="$compiler_flags $arg"
4257 # Some other compiler flag.
4259 func_quote_for_eval "$arg"
4260 arg="$func_quote_for_eval_result"
4264 # A standard object.
4269 # A libtool-controlled object.
4271 # Check to see that this really is a libtool object.
4272 if func_lalib_unsafe_p "$arg"; then
4279 if test -z "$pic_object" ||
4280 test -z "$non_pic_object" ||
4281 test "$pic_object" = none &&
4282 test "$non_pic_object" = none; then
4283 func_fatal_error "cannot find name of object for \`$arg'"
4286 # Extract subdirectory from the argument.
4287 func_dirname "$arg" "/" ""
4288 xdir="$func_dirname_result"
4290 if test "$pic_object" != none; then
4291 # Prepend the subdirectory the object is found in.
4292 pic_object="$xdir$pic_object"
4294 if test "$prev" = dlfiles; then
4295 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
4296 dlfiles="$dlfiles $pic_object"
4300 # If libtool objects are unsupported, then we need to preload.
4305 # CHECK ME: I think I busted this. -Ossama
4306 if test "$prev" = dlprefiles; then
4307 # Preload the old-style object.
4308 dlprefiles="$dlprefiles $pic_object"
4313 func_append libobjs " $pic_object"
4318 if test "$non_pic_object" != none; then
4319 # Prepend the subdirectory the object is found in.
4320 non_pic_object="$xdir$non_pic_object"
4322 # A standard non-PIC object
4323 func_append non_pic_objects " $non_pic_object"
4324 if test -z "$pic_object" || test "$pic_object" = none ; then
4325 arg="$non_pic_object"
4328 # If the PIC object exists, use it instead.
4329 # $xdir was prepended to $pic_object above.
4330 non_pic_object="$pic_object"
4331 func_append non_pic_objects " $non_pic_object"
4334 # Only an error if not doing a dry-run.
4335 if $opt_dry_run; then
4336 # Extract subdirectory from the argument.
4337 func_dirname "$arg" "/" ""
4338 xdir="$func_dirname_result"
4341 pic_object=$xdir$objdir/$func_lo2o_result
4342 non_pic_object=$xdir$func_lo2o_result
4343 func_append libobjs " $pic_object"
4344 func_append non_pic_objects " $non_pic_object"
4346 func_fatal_error "\`$arg' is not a valid libtool object"
4353 deplibs="$deplibs $arg"
4354 old_deplibs="$old_deplibs $arg"
4359 # A libtool-controlled library.
4361 if test "$prev" = dlfiles; then
4362 # This library was specified with -dlopen.
4363 dlfiles="$dlfiles $arg"
4365 elif test "$prev" = dlprefiles; then
4366 # The library was specified with -dlpreopen.
4367 dlprefiles="$dlprefiles $arg"
4370 deplibs="$deplibs $arg"
4375 # Some other compiler argument.
4377 # Unknown arguments in both finalize_command and compile_command need
4378 # to be aesthetically quoted because they are evaled later.
4379 func_quote_for_eval "$arg"
4380 arg="$func_quote_for_eval_result"
4384 # Now actually substitute the argument into the commands.
4385 if test -n "$arg"; then
4386 func_append compile_command " $arg"
4387 func_append finalize_command " $arg"
4389 done # argument parsing loop
4391 test -n "$prev" && \
4392 func_fatal_help "the \`$prevarg' option requires an argument"
4394 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
4395 eval arg=\"$export_dynamic_flag_spec\"
4396 func_append compile_command " $arg"
4397 func_append finalize_command " $arg"
4401 # calculate the name of the file, without its directory
4402 func_basename "$output"
4403 outputname="$func_basename_result"
4404 libobjs_save="$libobjs"
4406 if test -n "$shlibpath_var"; then
4407 # get the directories listed in $shlibpath_var
4408 eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
4412 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
4413 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
4415 func_dirname "$output" "/" ""
4416 output_objdir="$func_dirname_result$objdir"
4417 # Create the object directory.
4418 func_mkdir_p "$output_objdir"
4420 # Determine the type of output
4423 func_fatal_help "you must specify an output file"
4425 *.$libext) linkmode=oldlib ;;
4426 *.lo | *.$objext) linkmode=obj ;;
4427 *.la) linkmode=lib ;;
4428 *) linkmode=prog ;; # Anything else should be a program.
4434 # Find all interdependent deplibs by searching for libraries
4435 # that are linked more than once (e.g. -la -lb -la)
4436 for deplib in $deplibs; do
4437 if $opt_duplicate_deps ; then
4439 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
4442 libs="$libs $deplib"
4445 if test "$linkmode" = lib; then
4446 libs="$predeps $libs $compiler_lib_search_path $postdeps"
4448 # Compute libraries that are listed more than once in $predeps
4449 # $postdeps and mark them as special (i.e., whose duplicates are
4450 # not to be eliminated).
4452 if $opt_duplicate_compiler_generated_deps; then
4453 for pre_post_dep in $predeps $postdeps; do
4454 case "$pre_post_deps " in
4455 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
4457 pre_post_deps="$pre_post_deps $pre_post_dep"
4466 need_relink=no # whether we're linking any uninstalled libtool libraries
4467 notinst_deplibs= # not-installed libtool libraries
4468 notinst_path= # paths that contain not-installed libtool libraries
4472 passes="conv dlpreopen link"
4473 for file in $dlfiles $dlprefiles; do
4477 func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
4488 passes="conv scan dlopen dlpreopen link"
4494 for pass in $passes; do
4495 # The preopen pass in lib mode reverses $deplibs; put it back here
4496 # so that -L comes before libs that need it for instance...
4497 if test "$linkmode,$pass" = "lib,link"; then
4498 ## FIXME: Find the place where the list is rebuilt in the wrong
4499 ## order, and fix it there properly
4501 for deplib in $deplibs; do
4502 tmp_deplibs="$deplib $tmp_deplibs"
4504 deplibs="$tmp_deplibs"
4507 if test "$linkmode,$pass" = "lib,link" ||
4508 test "$linkmode,$pass" = "prog,scan"; then
4512 if test "$linkmode" = prog; then
4514 dlopen) libs="$dlfiles" ;;
4515 dlpreopen) libs="$dlprefiles" ;;
4516 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
4519 if test "$linkmode,$pass" = "lib,dlpreopen"; then
4520 # Collect and forward deplibs of preopened libtool libs
4521 for lib in $dlprefiles; do
4522 # Ignore non-libtool-libs
4525 *.la) func_source "$lib" ;;
4528 # Collect preopened libtool deplibs, except any this library
4529 # has declared as weak libs
4530 for deplib in $dependency_libs; do
4531 deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
4532 case " $weak_libs " in
4533 *" $deplib_base "*) ;;
4534 *) deplibs="$deplibs $deplib" ;;
4540 if test "$pass" = dlopen; then
4541 # Collect dlpreopened libraries
4542 save_deplibs="$deplibs"
4546 for deplib in $libs; do
4550 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
4551 if test "$linkmode,$pass" = "prog,link"; then
4552 compile_deplibs="$deplib $compile_deplibs"
4553 finalize_deplibs="$deplib $finalize_deplibs"
4555 compiler_flags="$compiler_flags $deplib"
4556 if test "$linkmode" = lib ; then
4557 case "$new_inherited_linker_flags " in
4559 * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
4566 if test "$linkmode" != lib && test "$linkmode" != prog; then
4567 func_warning "\`-l' is ignored for archives/objects"
4570 func_stripname '-l' '' "$deplib"
4571 name=$func_stripname_result
4572 if test "$linkmode" = lib; then
4573 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
4575 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
4577 for searchdir in $searchdirs; do
4578 for search_ext in .la $std_shrext .so .a; do
4579 # Search the libtool library
4580 lib="$searchdir/lib${name}${search_ext}"
4581 if test -f "$lib"; then
4582 if test "$search_ext" = ".la"; then
4591 if test "$found" != yes; then
4592 # deplib doesn't seem to be a libtool library
4593 if test "$linkmode,$pass" = "prog,link"; then
4594 compile_deplibs="$deplib $compile_deplibs"
4595 finalize_deplibs="$deplib $finalize_deplibs"
4597 deplibs="$deplib $deplibs"
4598 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
4601 else # deplib is a libtool library
4602 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
4603 # We need to do some special things here, and not later.
4604 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4605 case " $predeps $postdeps " in
4607 if func_lalib_p "$lib"; then
4611 for l in $old_library $library_names; do
4614 if test "X$ll" = "X$old_library" ; then # only static version available
4616 func_dirname "$lib" "" "."
4617 ladir="$func_dirname_result"
4618 lib=$ladir/$old_library
4619 if test "$linkmode,$pass" = "prog,link"; then
4620 compile_deplibs="$deplib $compile_deplibs"
4621 finalize_deplibs="$deplib $finalize_deplibs"
4623 deplibs="$deplib $deplibs"
4624 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
4636 if test "$linkmode,$pass" = "prog,link"; then
4637 compile_deplibs="$deplib $compile_deplibs"
4638 finalize_deplibs="$deplib $finalize_deplibs"
4640 deplibs="$deplib $deplibs"
4641 if test "$linkmode" = lib ; then
4642 case "$new_inherited_linker_flags " in
4644 * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
4653 deplibs="$deplib $deplibs"
4654 test "$pass" = conv && continue
4655 newdependency_libs="$deplib $newdependency_libs"
4656 func_stripname '-L' '' "$deplib"
4657 newlib_search_path="$newlib_search_path $func_stripname_result"
4660 if test "$pass" = conv; then
4661 deplibs="$deplib $deplibs"
4664 if test "$pass" = scan; then
4665 deplibs="$deplib $deplibs"
4667 compile_deplibs="$deplib $compile_deplibs"
4668 finalize_deplibs="$deplib $finalize_deplibs"
4670 func_stripname '-L' '' "$deplib"
4671 newlib_search_path="$newlib_search_path $func_stripname_result"
4674 func_warning "\`-L' is ignored for archives/objects"
4680 if test "$pass" = link; then
4681 func_stripname '-R' '' "$deplib"
4682 dir=$func_stripname_result
4683 # Make sure the xrpath contains only unique directories.
4686 *) xrpath="$xrpath $dir" ;;
4689 deplibs="$deplib $deplibs"
4692 *.la) lib="$deplib" ;;
4694 if test "$pass" = conv; then
4695 deplibs="$deplib $deplibs"
4700 # Linking convenience modules into shared libraries is allowed,
4701 # but linking other static libraries is non-portable.
4702 case " $dlpreconveniencelibs " in
4706 case $deplibs_check_method in
4708 set dummy $deplibs_check_method; shift
4709 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
4710 if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
4711 | $EGREP "$match_pattern_regex" > /dev/null; then
4719 if test "$valid_a_lib" != yes; then
4721 $ECHO "*** Warning: Trying to link with static lib archive $deplib."
4722 $ECHO "*** I have the capability to make that library automatically link in when"
4723 $ECHO "*** you link to this library. But I can only do this if you have a"
4724 $ECHO "*** shared version of the library, which you do not appear to have"
4725 $ECHO "*** because the file extensions .$libext of this argument makes me believe"
4726 $ECHO "*** that it is just a static archive that I should not use here."
4729 $ECHO "*** Warning: Linking the shared library $output against the"
4730 $ECHO "*** static library $deplib is not portable!"
4731 deplibs="$deplib $deplibs"
4738 if test "$pass" != link; then
4739 deplibs="$deplib $deplibs"
4741 compile_deplibs="$deplib $compile_deplibs"
4742 finalize_deplibs="$deplib $finalize_deplibs"
4749 if test "$pass" = conv; then
4750 deplibs="$deplib $deplibs"
4751 elif test "$linkmode" = prog; then
4752 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
4753 # If there is no dlopen support or we're linking statically,
4754 # we need to preload.
4755 newdlprefiles="$newdlprefiles $deplib"
4756 compile_deplibs="$deplib $compile_deplibs"
4757 finalize_deplibs="$deplib $finalize_deplibs"
4759 newdlfiles="$newdlfiles $deplib"
4770 if test "$found" = yes || test -f "$lib"; then :
4772 func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
4775 # Check to see that this really is a libtool archive.
4776 func_lalib_unsafe_p "$lib" \
4777 || func_fatal_error "\`$lib' is not a valid libtool archive"
4779 func_dirname "$lib" "" "."
4780 ladir="$func_dirname_result"
4788 inherited_linker_flags=
4789 # If the library was installed with an old release of libtool,
4790 # it will not redefine variables installed, or shouldnotlink
4799 # Convert "-framework foo" to "foo.ltframework"
4800 if test -n "$inherited_linker_flags"; then
4801 tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
4802 for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
4803 case " $new_inherited_linker_flags " in
4804 *" $tmp_inherited_linker_flag "*) ;;
4805 *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
4809 dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
4810 if test "$linkmode,$pass" = "lib,link" ||
4811 test "$linkmode,$pass" = "prog,scan" ||
4812 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
4813 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
4814 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
4817 if test "$pass" = conv; then
4818 # Only check for convenience libraries
4819 deplibs="$lib $deplibs"
4820 if test -z "$libdir"; then
4821 if test -z "$old_library"; then
4822 func_fatal_error "cannot find name of link library for \`$lib'"
4824 # It is a libtool convenience library, so add in its objects.
4825 convenience="$convenience $ladir/$objdir/$old_library"
4826 old_convenience="$old_convenience $ladir/$objdir/$old_library"
4827 elif test "$linkmode" != prog && test "$linkmode" != lib; then
4828 func_fatal_error "\`$lib' is not a convenience library"
4831 for deplib in $dependency_libs; do
4832 deplibs="$deplib $deplibs"
4833 if $opt_duplicate_deps ; then
4834 case "$tmp_libs " in
4835 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
4838 tmp_libs="$tmp_libs $deplib"
4844 # Get the name of the library we link against.
4846 for l in $old_library $library_names; do
4849 if test -z "$linklib"; then
4850 func_fatal_error "cannot find name of link library for \`$lib'"
4853 # This library was specified with -dlopen.
4854 if test "$pass" = dlopen; then
4855 if test -z "$libdir"; then
4856 func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
4858 if test -z "$dlname" ||
4859 test "$dlopen_support" != yes ||
4860 test "$build_libtool_libs" = no; then
4861 # If there is no dlname, no dlopen support or we're linking
4862 # statically, we need to preload. We also need to preload any
4863 # dependent libraries so libltdl's deplib preloader doesn't
4864 # bomb out in the load deplibs phase.
4865 dlprefiles="$dlprefiles $lib $dependency_libs"
4867 newdlfiles="$newdlfiles $lib"
4872 # We need an absolute path.
4874 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
4876 abs_ladir=`cd "$ladir" && pwd`
4877 if test -z "$abs_ladir"; then
4878 func_warning "cannot determine absolute directory name of \`$ladir'"
4879 func_warning "passing it literally to the linker, although it might fail"
4884 func_basename "$lib"
4885 laname="$func_basename_result"
4887 # Find the relevant object directory and library name.
4888 if test "X$installed" = Xyes; then
4889 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
4890 func_warning "library \`$lib' was moved."
4898 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
4900 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
4903 # Remove this search path later
4904 notinst_path="$notinst_path $abs_ladir"
4906 dir="$ladir/$objdir"
4907 absdir="$abs_ladir/$objdir"
4908 # Remove this search path later
4909 notinst_path="$notinst_path $abs_ladir"
4911 fi # $installed = yes
4912 func_stripname 'lib' '.la' "$laname"
4913 name=$func_stripname_result
4915 # This library was specified with -dlpreopen.
4916 if test "$pass" = dlpreopen; then
4917 if test -z "$libdir" && test "$linkmode" = prog; then
4918 func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
4920 # Prefer using a static library (so that no silly _DYNAMIC symbols
4921 # are required to link).
4922 if test -n "$old_library"; then
4923 newdlprefiles="$newdlprefiles $dir/$old_library"
4924 # Keep a list of preopened convenience libraries to check
4925 # that they are being used correctly in the link pass.
4926 test -z "$libdir" && \
4927 dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
4928 # Otherwise, use the dlname, so that lt_dlopen finds it.
4929 elif test -n "$dlname"; then
4930 newdlprefiles="$newdlprefiles $dir/$dlname"
4932 newdlprefiles="$newdlprefiles $dir/$linklib"
4934 fi # $pass = dlpreopen
4936 if test -z "$libdir"; then
4937 # Link the convenience library
4938 if test "$linkmode" = lib; then
4939 deplibs="$dir/$old_library $deplibs"
4940 elif test "$linkmode,$pass" = "prog,link"; then
4941 compile_deplibs="$dir/$old_library $compile_deplibs"
4942 finalize_deplibs="$dir/$old_library $finalize_deplibs"
4944 deplibs="$lib $deplibs" # used for prog,scan pass
4950 if test "$linkmode" = prog && test "$pass" != link; then
4951 newlib_search_path="$newlib_search_path $ladir"
4952 deplibs="$lib $deplibs"
4955 if test "$link_all_deplibs" != no || test -z "$library_names" ||
4956 test "$build_libtool_libs" = no; then
4961 for deplib in $dependency_libs; do
4963 -L*) func_stripname '-L' '' "$deplib"
4964 newlib_search_path="$newlib_search_path $func_stripname_result"
4967 # Need to link against all dependency_libs?
4968 if test "$linkalldeplibs" = yes; then
4969 deplibs="$deplib $deplibs"
4971 # Need to hardcode shared library paths
4972 # or/and link against static libraries
4973 newdependency_libs="$deplib $newdependency_libs"
4975 if $opt_duplicate_deps ; then
4976 case "$tmp_libs " in
4977 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
4980 tmp_libs="$tmp_libs $deplib"
4983 fi # $linkmode = prog...
4985 if test "$linkmode,$pass" = "prog,link"; then
4986 if test -n "$library_names" &&
4987 { { test "$prefer_static_libs" = no ||
4988 test "$prefer_static_libs,$installed" = "built,yes"; } ||
4989 test -z "$old_library"; }; then
4990 # We need to hardcode the library path
4991 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
4992 # Make sure the rpath contains only unique directories.
4993 case "$temp_rpath:" in
4995 *) temp_rpath="$temp_rpath$absdir:" ;;
4999 # Hardcode the library path.
5000 # Skip directories that are in the system default run-time
5002 case " $sys_lib_dlsearch_path " in
5005 case "$compile_rpath " in
5007 *) compile_rpath="$compile_rpath $absdir"
5011 case " $sys_lib_dlsearch_path " in
5014 case "$finalize_rpath " in
5016 *) finalize_rpath="$finalize_rpath $libdir"
5020 fi # $linkmode,$pass = prog,link...
5022 if test "$alldeplibs" = yes &&
5023 { test "$deplibs_check_method" = pass_all ||
5024 { test "$build_libtool_libs" = yes &&
5025 test -n "$library_names"; }; }; then
5026 # We only need to search for static libraries
5031 link_static=no # Whether the deplib will be linked statically
5032 use_static_libs=$prefer_static_libs
5033 if test "$use_static_libs" = built && test "$installed" = yes; then
5036 if test -n "$library_names" &&
5037 { test "$use_static_libs" = no || test -z "$old_library"; }; then
5040 # No point in relinking DLLs because paths are not encoded
5041 notinst_deplibs="$notinst_deplibs $lib"
5045 if test "$installed" = no; then
5046 notinst_deplibs="$notinst_deplibs $lib"
5051 # This is a shared library
5053 # Warn about portability, can't link against -module's on some
5054 # systems (darwin). Don't bleat about dlopened modules though!
5056 for dlpremoduletest in $dlprefiles; do
5057 if test "X$dlpremoduletest" = "X$lib"; then
5058 dlopenmodule="$dlpremoduletest"
5062 if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
5064 if test "$linkmode" = prog; then
5065 $ECHO "*** Warning: Linking the executable $output against the loadable module"
5067 $ECHO "*** Warning: Linking the shared library $output against the loadable module"
5069 $ECHO "*** $linklib is not portable!"
5071 if test "$linkmode" = lib &&
5072 test "$hardcode_into_libs" = yes; then
5073 # Hardcode the library path.
5074 # Skip directories that are in the system default run-time
5076 case " $sys_lib_dlsearch_path " in
5079 case "$compile_rpath " in
5081 *) compile_rpath="$compile_rpath $absdir"
5085 case " $sys_lib_dlsearch_path " in
5088 case "$finalize_rpath " in
5090 *) finalize_rpath="$finalize_rpath $libdir"
5096 if test -n "$old_archive_from_expsyms_cmds"; then
5097 # figure out the soname
5098 set dummy $library_names
5102 libname=`eval "\\$ECHO \"$libname_spec\""`
5103 # use dlname if we got it. it's perfectly good, no?
5104 if test -n "$dlname"; then
5106 elif test -n "$soname_spec"; then
5110 func_arith $current - $age
5111 major=$func_arith_result
5115 eval soname=\"$soname_spec\"
5120 # Make a new name for the extract_expsyms_cmds to use
5122 func_basename "$soroot"
5123 soname="$func_basename_result"
5124 func_stripname 'lib' '.dll' "$soname"
5125 newlib=libimp-$func_stripname_result.a
5127 # If the library has no export list, then create one now
5128 if test -f "$output_objdir/$soname-def"; then :
5130 func_verbose "extracting exported symbol list from \`$soname'"
5131 func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
5135 if test -f "$output_objdir/$newlib"; then :; else
5136 func_verbose "generating import library for \`$soname'"
5137 func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
5139 # make sure the library variables are pointing to the new library
5142 fi # test -n "$old_archive_from_expsyms_cmds"
5144 if test "$linkmode" = prog || test "$mode" != relink; then
5149 case $hardcode_action in
5150 immediate | unsupported)
5151 if test "$hardcode_direct" = no; then
5154 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
5155 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
5156 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
5157 *-*-unixware7*) add_dir="-L$dir" ;;
5159 # if the lib is a (non-dlopened) module then we can not
5160 # link against it, someone is ignoring the earlier warnings
5161 if /usr/bin/file -L $add 2> /dev/null |
5162 $GREP ": [^:]* bundle" >/dev/null ; then
5163 if test "X$dlopenmodule" != "X$lib"; then
5164 $ECHO "*** Warning: lib $linklib is a module, not a shared library"
5165 if test -z "$old_library" ; then
5167 $ECHO "*** And there doesn't seem to be a static archive available"
5168 $ECHO "*** The link will probably fail, sorry"
5170 add="$dir/$old_library"
5172 elif test -n "$old_library"; then
5173 add="$dir/$old_library"
5177 elif test "$hardcode_minus_L" = no; then
5179 *-*-sunos*) add_shlibpath="$dir" ;;
5183 elif test "$hardcode_shlibpath_var" = no; then
5184 add_shlibpath="$dir"
5191 if test "$hardcode_direct" = yes &&
5192 test "$hardcode_direct_absolute" = no; then
5194 elif test "$hardcode_minus_L" = yes; then
5196 # Try looking first in the location we're being installed to.
5197 if test -n "$inst_prefix_dir"; then
5200 add_dir="$add_dir -L$inst_prefix_dir$libdir"
5205 elif test "$hardcode_shlibpath_var" = yes; then
5206 add_shlibpath="$dir"
5215 if test "$lib_linked" != yes; then
5216 func_fatal_configuration "unsupported hardcode properties"
5219 if test -n "$add_shlibpath"; then
5220 case :$compile_shlibpath: in
5221 *":$add_shlibpath:"*) ;;
5222 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
5225 if test "$linkmode" = prog; then
5226 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
5227 test -n "$add" && compile_deplibs="$add $compile_deplibs"
5229 test -n "$add_dir" && deplibs="$add_dir $deplibs"
5230 test -n "$add" && deplibs="$add $deplibs"
5231 if test "$hardcode_direct" != yes &&
5232 test "$hardcode_minus_L" != yes &&
5233 test "$hardcode_shlibpath_var" = yes; then
5234 case :$finalize_shlibpath: in
5236 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
5242 if test "$linkmode" = prog || test "$mode" = relink; then
5246 # Finalize command for both is simple: just hardcode it.
5247 if test "$hardcode_direct" = yes &&
5248 test "$hardcode_direct_absolute" = no; then
5249 add="$libdir/$linklib"
5250 elif test "$hardcode_minus_L" = yes; then
5253 elif test "$hardcode_shlibpath_var" = yes; then
5254 case :$finalize_shlibpath: in
5256 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
5259 elif test "$hardcode_automatic" = yes; then
5260 if test -n "$inst_prefix_dir" &&
5261 test -f "$inst_prefix_dir$libdir/$linklib" ; then
5262 add="$inst_prefix_dir$libdir/$linklib"
5264 add="$libdir/$linklib"
5267 # We cannot seem to hardcode it, guess we'll fake it.
5269 # Try looking first in the location we're being installed to.
5270 if test -n "$inst_prefix_dir"; then
5273 add_dir="$add_dir -L$inst_prefix_dir$libdir"
5280 if test "$linkmode" = prog; then
5281 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
5282 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
5284 test -n "$add_dir" && deplibs="$add_dir $deplibs"
5285 test -n "$add" && deplibs="$add $deplibs"
5288 elif test "$linkmode" = prog; then
5289 # Here we assume that one of hardcode_direct or hardcode_minus_L
5290 # is not unsupported. This is valid on all known static and
5292 if test "$hardcode_direct" != unsupported; then
5293 test -n "$old_library" && linklib="$old_library"
5294 compile_deplibs="$dir/$linklib $compile_deplibs"
5295 finalize_deplibs="$dir/$linklib $finalize_deplibs"
5297 compile_deplibs="-l$name -L$dir $compile_deplibs"
5298 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
5300 elif test "$build_libtool_libs" = yes; then
5301 # Not a shared library
5302 if test "$deplibs_check_method" != pass_all; then
5303 # We're trying link a shared library against a static one
5304 # but the system doesn't support it.
5306 # Just print a warning and add the library to dependency_libs so
5307 # that the program can be linked against the static library.
5309 $ECHO "*** Warning: This system can not link to static lib archive $lib."
5310 $ECHO "*** I have the capability to make that library automatically link in when"
5311 $ECHO "*** you link to this library. But I can only do this if you have a"
5312 $ECHO "*** shared version of the library, which you do not appear to have."
5313 if test "$module" = yes; then
5314 $ECHO "*** But as you try to build a module library, libtool will still create "
5315 $ECHO "*** a static module, that should work as long as the dlopening application"
5316 $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
5317 if test -z "$global_symbol_pipe"; then
5319 $ECHO "*** However, this would only work if libtool was able to extract symbol"
5320 $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
5321 $ECHO "*** not find such a program. So, this module is probably useless."
5322 $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
5324 if test "$build_old_libs" = no; then
5325 build_libtool_libs=module
5328 build_libtool_libs=no
5332 deplibs="$dir/$old_library $deplibs"
5335 fi # link shared/static library?
5337 if test "$linkmode" = lib; then
5338 if test -n "$dependency_libs" &&
5339 { test "$hardcode_into_libs" != yes ||
5340 test "$build_old_libs" = yes ||
5341 test "$link_static" = yes; }; then
5342 # Extract -R from dependency_libs
5344 for libdir in $dependency_libs; do
5346 -R*) func_stripname '-R' '' "$libdir"
5347 temp_xrpath=$func_stripname_result
5349 *" $temp_xrpath "*) ;;
5350 *) xrpath="$xrpath $temp_xrpath";;
5352 *) temp_deplibs="$temp_deplibs $libdir";;
5355 dependency_libs="$temp_deplibs"
5358 newlib_search_path="$newlib_search_path $absdir"
5359 # Link against this library
5360 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
5361 # ... and its dependency_libs
5363 for deplib in $dependency_libs; do
5364 newdependency_libs="$deplib $newdependency_libs"
5365 if $opt_duplicate_deps ; then
5366 case "$tmp_libs " in
5367 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
5370 tmp_libs="$tmp_libs $deplib"
5373 if test "$link_all_deplibs" != no; then
5374 # Add the search paths of all dependency libraries
5375 for deplib in $dependency_libs; do
5377 -L*) path="$deplib" ;;
5379 func_dirname "$deplib" "" "."
5380 dir="$func_dirname_result"
5381 # We need an absolute path.
5383 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
5385 absdir=`cd "$dir" && pwd`
5386 if test -z "$absdir"; then
5387 func_warning "cannot determine absolute directory name of \`$dir'"
5392 if $GREP "^installed=no" $deplib > /dev/null; then
5396 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
5397 if test -n "$deplibrary_names" ; then
5398 for tmp in $deplibrary_names ; do
5401 if test -f "$absdir/$objdir/$depdepl" ; then
5402 depdepl="$absdir/$objdir/$depdepl"
5403 darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
5404 if test -z "$darwin_install_name"; then
5405 darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
5407 compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
5408 linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
5414 path="-L$absdir/$objdir"
5418 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5419 test -z "$libdir" && \
5420 func_fatal_error "\`$deplib' is not a valid libtool archive"
5421 test "$absdir" != "$libdir" && \
5422 func_warning "\`$deplib' seems to be moved"
5428 case " $deplibs " in
5430 *) deplibs="$path $deplibs" ;;
5433 fi # link_all_deplibs != no
5435 done # for deplib in $libs
5436 if test "$pass" = link; then
5437 if test "$linkmode" = "prog"; then
5438 compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
5439 finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
5441 compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
5444 dependency_libs="$newdependency_libs"
5445 if test "$pass" = dlpreopen; then
5446 # Link the dlpreopened libraries before other libraries
5447 for deplib in $save_deplibs; do
5448 deplibs="$deplib $deplibs"
5451 if test "$pass" != dlopen; then
5452 if test "$pass" != conv; then
5453 # Make sure lib_search_path contains only unique directories.
5455 for dir in $newlib_search_path; do
5456 case "$lib_search_path " in
5458 *) lib_search_path="$lib_search_path $dir" ;;
5464 if test "$linkmode,$pass" != "prog,link"; then
5467 vars="compile_deplibs finalize_deplibs"
5469 for var in $vars dependency_libs; do
5470 # Add libraries to $var in reverse order
5471 eval tmp_libs=\"\$$var\"
5473 for deplib in $tmp_libs; do
5474 # FIXME: Pedantically, this is the right thing to do, so
5475 # that some nasty dependency loop isn't accidentally
5477 #new_libs="$deplib $new_libs"
5478 # Pragmatically, this seems to cause very few problems in
5481 -L*) new_libs="$deplib $new_libs" ;;
5484 # And here is the reason: when a library appears more
5485 # than once as an explicit dependence of a library, or
5486 # is implicitly linked in more than once by the
5487 # compiler, it is considered special, and multiple
5488 # occurrences thereof are not removed. Compare this
5489 # with having the same library being listed as a
5490 # dependency of multiple other libraries: in this case,
5491 # we know (pedantically, we assume) the library does not
5492 # need to be listed more than once, so we keep only the
5493 # last copy. This is not always right, but it is rare
5494 # enough that we require users that really mean to play
5495 # such unportable linking tricks to link the library
5496 # using -Wl,-lname, so that libtool does not consider it
5497 # for duplicate removal.
5498 case " $specialdeplibs " in
5499 *" $deplib "*) new_libs="$deplib $new_libs" ;;
5501 case " $new_libs " in
5503 *) new_libs="$deplib $new_libs" ;;
5511 for deplib in $new_libs; do
5514 case " $tmp_libs " in
5516 *) tmp_libs="$tmp_libs $deplib" ;;
5519 *) tmp_libs="$tmp_libs $deplib" ;;
5522 eval $var=\"$tmp_libs\"
5525 # Last step: remove runtime libs from dependency_libs
5526 # (they stay in deplibs)
5528 for i in $dependency_libs ; do
5529 case " $predeps $postdeps $compiler_lib_search_path " in
5534 if test -n "$i" ; then
5535 tmp_libs="$tmp_libs $i"
5538 dependency_libs=$tmp_libs
5540 if test "$linkmode" = prog; then
5541 dlfiles="$newdlfiles"
5543 if test "$linkmode" = prog || test "$linkmode" = lib; then
5544 dlprefiles="$newdlprefiles"
5549 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
5550 func_warning "\`-dlopen' is ignored for archives"
5555 func_warning "\`-l' and \`-L' are ignored for archives" ;;
5558 test -n "$rpath" && \
5559 func_warning "\`-rpath' is ignored for archives"
5561 test -n "$xrpath" && \
5562 func_warning "\`-R' is ignored for archives"
5564 test -n "$vinfo" && \
5565 func_warning "\`-version-info/-version-number' is ignored for archives"
5567 test -n "$release" && \
5568 func_warning "\`-release' is ignored for archives"
5570 test -n "$export_symbols$export_symbols_regex" && \
5571 func_warning "\`-export-symbols' is ignored for archives"
5573 # Now set the variables for building old libraries.
5574 build_libtool_libs=no
5576 objs="$objs$old_deplibs"
5580 # Make sure we only generate libraries of the form `libNAME.la'.
5583 func_stripname 'lib' '.la' "$outputname"
5584 name=$func_stripname_result
5585 eval shared_ext=\"$shrext_cmds\"
5586 eval libname=\"$libname_spec\"
5589 test "$module" = no && \
5590 func_fatal_help "libtool library \`$output' must begin with \`lib'"
5592 if test "$need_lib_prefix" != no; then
5593 # Add the "lib" prefix for modules if required
5594 func_stripname '' '.la' "$outputname"
5595 name=$func_stripname_result
5596 eval shared_ext=\"$shrext_cmds\"
5597 eval libname=\"$libname_spec\"
5599 func_stripname '' '.la' "$outputname"
5600 libname=$func_stripname_result
5605 if test -n "$objs"; then
5606 if test "$deplibs_check_method" != pass_all; then
5607 func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
5610 $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
5611 $ECHO "*** objects $objs is not portable!"
5612 libobjs="$libobjs $objs"
5616 test "$dlself" != no && \
5617 func_warning "\`-dlopen self' is ignored for libtool libraries"
5621 test "$#" -gt 1 && \
5622 func_warning "ignoring multiple \`-rpath's for a libtool library"
5627 if test -z "$rpath"; then
5628 if test "$build_libtool_libs" = yes; then
5629 # Building a libtool convenience library.
5630 # Some compilers have problems with a `.al' extension so
5631 # convenience libraries should have the same extension an
5632 # archive normally would.
5633 oldlibs="$output_objdir/$libname.$libext $oldlibs"
5634 build_libtool_libs=convenience
5638 test -n "$vinfo" && \
5639 func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
5641 test -n "$release" && \
5642 func_warning "\`-release' is ignored for convenience libraries"
5645 # Parse the version information argument.
5646 save_ifs="$IFS"; IFS=':'
5647 set dummy $vinfo 0 0 0
5652 func_fatal_help "too many parameters to \`-version-info'"
5654 # convert absolute version numbers to libtool ages
5655 # this retains compatibility with .la files and attempts
5656 # to make the code below a bit more comprehensible
5658 case $vinfo_number in
5662 number_revision="$3"
5664 # There are really only two kinds -- those that
5665 # use the current revision as the major version
5666 # and those that subtract age and use age as
5667 # a minor version. But, then there is irix
5668 # which has an extra 1 added just for fun
5670 case $version_type in
5671 darwin|linux|osf|windows|none)
5672 func_arith $number_major + $number_minor
5673 current=$func_arith_result
5675 revision="$number_revision"
5677 freebsd-aout|freebsd-elf|sunos)
5678 current="$number_major"
5679 revision="$number_minor"
5683 func_arith $number_major + $number_minor
5684 current=$func_arith_result
5686 revision="$number_minor"
5687 lt_irix_increment=no
5698 # Check that each of the things are valid numbers.
5700 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]) ;;
5702 func_error "CURRENT \`$current' must be a nonnegative integer"
5703 func_fatal_error "\`$vinfo' is not valid version information"
5708 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]) ;;
5710 func_error "REVISION \`$revision' must be a nonnegative integer"
5711 func_fatal_error "\`$vinfo' is not valid version information"
5716 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]) ;;
5718 func_error "AGE \`$age' must be a nonnegative integer"
5719 func_fatal_error "\`$vinfo' is not valid version information"
5723 if test "$age" -gt "$current"; then
5724 func_error "AGE \`$age' is greater than the current interface number \`$current'"
5725 func_fatal_error "\`$vinfo' is not valid version information"
5728 # Calculate the version variables.
5732 case $version_type in
5736 # Like Linux, but with the current version available in
5737 # verstring for coding it into the library header
5738 func_arith $current - $age
5739 major=.$func_arith_result
5740 versuffix="$major.$age.$revision"
5741 # Darwin ld doesn't like 0 for these options...
5742 func_arith $current + 1
5743 minor_current=$func_arith_result
5744 xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
5745 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
5750 versuffix=".$current.$revision";
5755 versuffix=".$current"
5759 if test "X$lt_irix_increment" = "Xno"; then
5760 func_arith $current - $age
5762 func_arith $current - $age + 1
5764 major=$func_arith_result
5766 case $version_type in
5767 nonstopux) verstring_prefix=nonstopux ;;
5768 *) verstring_prefix=sgi ;;
5770 verstring="$verstring_prefix$major.$revision"
5772 # Add in all the interfaces that we are compatible with.
5774 while test "$loop" -ne 0; do
5775 func_arith $revision - $loop
5776 iface=$func_arith_result
5777 func_arith $loop - 1
5778 loop=$func_arith_result
5779 verstring="$verstring_prefix$major.$iface:$verstring"
5782 # Before this point, $major must not contain `.'.
5784 versuffix="$major.$revision"
5788 func_arith $current - $age
5789 major=.$func_arith_result
5790 versuffix="$major.$age.$revision"
5794 func_arith $current - $age
5795 major=.$func_arith_result
5796 versuffix=".$current.$age.$revision"
5797 verstring="$current.$age.$revision"
5799 # Add in all the interfaces that we are compatible with.
5801 while test "$loop" -ne 0; do
5802 func_arith $current - $loop
5803 iface=$func_arith_result
5804 func_arith $loop - 1
5805 loop=$func_arith_result
5806 verstring="$verstring:${iface}.0"
5809 # Make executables depend on our current version.
5810 verstring="$verstring:${current}.0"
5815 versuffix=".$current"
5820 versuffix=".$current.$revision"
5824 # Use '-' rather than '.', since we only want one
5825 # extension on DOS 8.3 filesystems.
5826 func_arith $current - $age
5827 major=$func_arith_result
5832 func_fatal_configuration "unknown library version type \`$version_type'"
5836 # Clear the version info if we defaulted, and they specified a release.
5837 if test -z "$vinfo" && test -n "$release"; then
5839 case $version_type in
5841 # we can't check for "0.0" in archive_cmds due to quoting
5842 # problems, so we reset it completely
5849 if test "$need_version" = no; then
5856 # Remove version info from name if versioning should be avoided
5857 if test "$avoid_version" = yes && test "$need_version" = no; then
5863 # Check to see if the archive will have undefined symbols.
5864 if test "$allow_undefined" = yes; then
5865 if test "$allow_undefined_flag" = unsupported; then
5866 func_warning "undefined symbols not allowed in $host shared libraries"
5867 build_libtool_libs=no
5871 # Don't allow undefined symbols.
5872 allow_undefined_flag="$no_undefined_flag"
5877 func_generate_dlsyms "$libname" "$libname" "yes"
5878 libobjs="$libobjs $symfileobj"
5879 test "X$libobjs" = "X " && libobjs=
5881 if test "$mode" != relink; then
5882 # Remove our outputs, but don't remove object files since they
5883 # may have been created when compiling PIC objects.
5885 tempremovelist=`$ECHO "$output_objdir/*"`
5886 for p in $tempremovelist; do
5890 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
5891 if test "X$precious_files_regex" != "X"; then
5892 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
5897 removelist="$removelist $p"
5902 test -n "$removelist" && \
5903 func_show_eval "${RM}r \$removelist"
5906 # Now set the variables for building old libraries.
5907 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
5908 oldlibs="$oldlibs $output_objdir/$libname.$libext"
5910 # Transform .lo files to .o files.
5911 oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
5914 # Eliminate all temporary directories.
5915 #for path in $notinst_path; do
5916 # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
5917 # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
5918 # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
5921 if test -n "$xrpath"; then
5922 # If the user specified any rpath flags, then add them.
5924 for libdir in $xrpath; do
5925 temp_xrpath="$temp_xrpath -R$libdir"
5926 case "$finalize_rpath " in
5928 *) finalize_rpath="$finalize_rpath $libdir" ;;
5931 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
5932 dependency_libs="$temp_xrpath $dependency_libs"
5936 # Make sure dlfiles contains only unique files that won't be dlpreopened
5937 old_dlfiles="$dlfiles"
5939 for lib in $old_dlfiles; do
5940 case " $dlprefiles $dlfiles " in
5942 *) dlfiles="$dlfiles $lib" ;;
5946 # Make sure dlprefiles contains only unique files
5947 old_dlprefiles="$dlprefiles"
5949 for lib in $old_dlprefiles; do
5950 case "$dlprefiles " in
5952 *) dlprefiles="$dlprefiles $lib" ;;
5956 if test "$build_libtool_libs" = yes; then
5957 if test -n "$rpath"; then
5959 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
5960 # these systems don't actually have a c library (as such)!
5962 *-*-rhapsody* | *-*-darwin1.[012])
5963 # Rhapsody C library is in the System framework
5964 deplibs="$deplibs System.ltframework"
5967 # Don't link with libc until the a.out ld.so is fixed.
5969 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
5970 # Do not include libc due to us having libc/libc_r.
5972 *-*-sco3.2v5* | *-*-sco5v6*)
5973 # Causes problems with __ctype
5975 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
5976 # Compiler inserts libc in the correct place for threads to work
5979 # Add libc to deplibs on all other systems if necessary.
5980 if test "$build_libtool_need_lc" = "yes"; then
5981 deplibs="$deplibs -lc"
5987 # Transform deplibs into only deplibs that can be linked in shared.
5989 libname_save=$libname
5990 release_save=$release
5991 versuffix_save=$versuffix
5993 # I'm not sure if I'm treating the release correctly. I think
5994 # release should show up in the -l (ie -lgmp5) so we don't want to
5995 # add it in twice. Is that correct?
6001 case $deplibs_check_method in
6003 # Don't check for shared/static. Everything works.
6004 # This might be a little naive. We might want to check
6005 # whether the library exists or not. But this is on
6006 # osf3 & osf4 and I'm not really sure... Just
6007 # implementing what was already the behavior.
6011 # This code stresses the "libraries are programs" paradigm to its
6012 # limits. Maybe even breaks it. We compile a program, linking it
6013 # against the deplibs as a proxy for the library. Then we can check
6014 # whether they linked in statically or dynamically with ldd.
6015 $opt_dry_run || $RM conftest.c
6016 cat > conftest.c <<EOF
6017 int main() { return 0; }
6019 $opt_dry_run || $RM conftest
6020 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
6021 ldd_output=`ldd conftest`
6022 for i in $deplibs; do
6025 func_stripname -l '' "$i"
6026 name=$func_stripname_result
6027 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6028 case " $predeps $postdeps " in
6030 newdeplibs="$newdeplibs $i"
6035 if test -n "$i" ; then
6036 libname=`eval "\\$ECHO \"$libname_spec\""`
6037 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
6038 set dummy $deplib_matches; shift
6040 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
6041 newdeplibs="$newdeplibs $i"
6045 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
6046 $ECHO "*** I have the capability to make that library automatically link in when"
6047 $ECHO "*** you link to this library. But I can only do this if you have a"
6048 $ECHO "*** shared version of the library, which I believe you do not have"
6049 $ECHO "*** because a test_compile did reveal that the linker did not use it for"
6050 $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
6055 newdeplibs="$newdeplibs $i"
6060 # Error occurred in the first compile. Let's try to salvage
6061 # the situation: Compile a separate program for each library.
6062 for i in $deplibs; do
6065 func_stripname -l '' "$i"
6066 name=$func_stripname_result
6067 $opt_dry_run || $RM conftest
6068 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
6069 ldd_output=`ldd conftest`
6070 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6071 case " $predeps $postdeps " in
6073 newdeplibs="$newdeplibs $i"
6078 if test -n "$i" ; then
6079 libname=`eval "\\$ECHO \"$libname_spec\""`
6080 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
6081 set dummy $deplib_matches; shift
6083 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
6084 newdeplibs="$newdeplibs $i"
6088 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
6089 $ECHO "*** I have the capability to make that library automatically link in when"
6090 $ECHO "*** you link to this library. But I can only do this if you have a"
6091 $ECHO "*** shared version of the library, which you do not appear to have"
6092 $ECHO "*** because a test_compile did reveal that the linker did not use this one"
6093 $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
6099 $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
6100 $ECHO "*** make it link in! You will probably need to install it or some"
6101 $ECHO "*** library that it depends on before this library will be fully"
6102 $ECHO "*** functional. Installing it before continuing would be even better."
6106 newdeplibs="$newdeplibs $i"
6113 set dummy $deplibs_check_method; shift
6114 file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
6115 for a_deplib in $deplibs; do
6118 func_stripname -l '' "$a_deplib"
6119 name=$func_stripname_result
6120 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6121 case " $predeps $postdeps " in
6123 newdeplibs="$newdeplibs $a_deplib"
6128 if test -n "$a_deplib" ; then
6129 libname=`eval "\\$ECHO \"$libname_spec\""`
6130 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
6131 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
6132 for potent_lib in $potential_libs; do
6133 # Follow soft links.
6134 if ls -lLd "$potent_lib" 2>/dev/null |
6135 $GREP " -> " >/dev/null; then
6138 # The statement above tries to avoid entering an
6139 # endless loop below, in case of cyclic links.
6140 # We might still enter an endless loop, since a link
6141 # loop can be closed while we follow links,
6143 potlib="$potent_lib"
6144 while test -h "$potlib" 2>/dev/null; do
6145 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
6147 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
6148 *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
6151 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
6153 $EGREP "$file_magic_regex" > /dev/null; then
6154 newdeplibs="$newdeplibs $a_deplib"
6161 if test -n "$a_deplib" ; then
6164 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
6165 $ECHO "*** I have the capability to make that library automatically link in when"
6166 $ECHO "*** you link to this library. But I can only do this if you have a"
6167 $ECHO "*** shared version of the library, which you do not appear to have"
6168 $ECHO "*** because I did check the linker path looking for a file starting"
6169 if test -z "$potlib" ; then
6170 $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
6172 $ECHO "*** with $libname and none of the candidates passed a file format test"
6173 $ECHO "*** using a file magic. Last file checked: $potlib"
6178 # Add a -L argument.
6179 newdeplibs="$newdeplibs $a_deplib"
6182 done # Gone through all deplibs.
6185 set dummy $deplibs_check_method; shift
6186 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
6187 for a_deplib in $deplibs; do
6190 func_stripname -l '' "$a_deplib"
6191 name=$func_stripname_result
6192 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6193 case " $predeps $postdeps " in
6195 newdeplibs="$newdeplibs $a_deplib"
6200 if test -n "$a_deplib" ; then
6201 libname=`eval "\\$ECHO \"$libname_spec\""`
6202 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
6203 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
6204 for potent_lib in $potential_libs; do
6205 potlib="$potent_lib" # see symlink-check above in file_magic test
6206 if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
6207 $EGREP "$match_pattern_regex" > /dev/null; then
6208 newdeplibs="$newdeplibs $a_deplib"
6215 if test -n "$a_deplib" ; then
6218 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
6219 $ECHO "*** I have the capability to make that library automatically link in when"
6220 $ECHO "*** you link to this library. But I can only do this if you have a"
6221 $ECHO "*** shared version of the library, which you do not appear to have"
6222 $ECHO "*** because I did check the linker path looking for a file starting"
6223 if test -z "$potlib" ; then
6224 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
6226 $ECHO "*** with $libname and none of the candidates passed a file format test"
6227 $ECHO "*** using a regex pattern. Last file checked: $potlib"
6232 # Add a -L argument.
6233 newdeplibs="$newdeplibs $a_deplib"
6236 done # Gone through all deplibs.
6240 tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
6241 -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
6242 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6243 for i in $predeps $postdeps ; do
6244 # can't use Xsed below, because $i might contain '/'
6245 tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
6248 if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' |
6249 $GREP . >/dev/null; then
6251 if test "X$deplibs_check_method" = "Xnone"; then
6252 $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
6254 $ECHO "*** Warning: inter-library dependencies are not known to be supported."
6256 $ECHO "*** All declared inter-library dependencies are being dropped."
6261 versuffix=$versuffix_save
6263 release=$release_save
6264 libname=$libname_save
6268 *-*-rhapsody* | *-*-darwin1.[012])
6269 # On Rhapsody replace the C library with the System framework
6270 newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
6274 if test "$droppeddeps" = yes; then
6275 if test "$module" = yes; then
6277 $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
6278 $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
6279 $ECHO "*** a static module, that should work as long as the dlopening"
6280 $ECHO "*** application is linked with the -dlopen flag."
6281 if test -z "$global_symbol_pipe"; then
6283 $ECHO "*** However, this would only work if libtool was able to extract symbol"
6284 $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
6285 $ECHO "*** not find such a program. So, this module is probably useless."
6286 $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
6288 if test "$build_old_libs" = no; then
6289 oldlibs="$output_objdir/$libname.$libext"
6290 build_libtool_libs=module
6293 build_libtool_libs=no
6296 $ECHO "*** The inter-library dependencies that have been dropped here will be"
6297 $ECHO "*** automatically added whenever a program is linked with this library"
6298 $ECHO "*** or is declared to -dlopen it."
6300 if test "$allow_undefined" = no; then
6302 $ECHO "*** Since this library must not contain undefined symbols,"
6303 $ECHO "*** because either the platform does not support them or"
6304 $ECHO "*** it was explicitly requested with -no-undefined,"
6305 $ECHO "*** libtool will only create a static version of it."
6306 if test "$build_old_libs" = no; then
6307 oldlibs="$output_objdir/$libname.$libext"
6308 build_libtool_libs=module
6311 build_libtool_libs=no
6316 # Done checking deplibs!
6319 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
6322 newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
6323 new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
6324 deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
6328 # move library search paths that coincide with paths to not yet
6329 # installed libraries to the beginning of the library search list
6331 for path in $notinst_path; do
6332 case " $new_libs " in
6333 *" -L$path/$objdir "*) ;;
6335 case " $deplibs " in
6336 *" -L$path/$objdir "*)
6337 new_libs="$new_libs -L$path/$objdir" ;;
6342 for deplib in $deplibs; do
6345 case " $new_libs " in
6347 *) new_libs="$new_libs $deplib" ;;
6350 *) new_libs="$new_libs $deplib" ;;
6355 # All the library-specific variables (install_libdir is set above).
6360 # Test again, we may have decided not to build it any more
6361 if test "$build_libtool_libs" = yes; then
6362 if test "$hardcode_into_libs" = yes; then
6363 # Hardcode the library paths
6366 rpath="$finalize_rpath"
6367 test "$mode" != relink && rpath="$compile_rpath$rpath"
6368 for libdir in $rpath; do
6369 if test -n "$hardcode_libdir_flag_spec"; then
6370 if test -n "$hardcode_libdir_separator"; then
6371 if test -z "$hardcode_libdirs"; then
6372 hardcode_libdirs="$libdir"
6374 # Just accumulate the unique libdirs.
6375 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
6376 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
6379 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
6384 eval flag=\"$hardcode_libdir_flag_spec\"
6385 dep_rpath="$dep_rpath $flag"
6387 elif test -n "$runpath_var"; then
6388 case "$perm_rpath " in
6390 *) perm_rpath="$perm_rpath $libdir" ;;
6394 # Substitute the hardcoded libdirs into the rpath.
6395 if test -n "$hardcode_libdir_separator" &&
6396 test -n "$hardcode_libdirs"; then
6397 libdir="$hardcode_libdirs"
6398 if test -n "$hardcode_libdir_flag_spec_ld"; then
6399 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
6401 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
6404 if test -n "$runpath_var" && test -n "$perm_rpath"; then
6405 # We should set the runpath_var.
6407 for dir in $perm_rpath; do
6410 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
6412 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
6415 shlibpath="$finalize_shlibpath"
6416 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
6417 if test -n "$shlibpath"; then
6418 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
6421 # Get the real and link names of the library.
6422 eval shared_ext=\"$shrext_cmds\"
6423 eval library_names=\"$library_names_spec\"
6424 set dummy $library_names
6429 if test -n "$soname_spec"; then
6430 eval soname=\"$soname_spec\"
6434 if test -z "$dlname"; then
6438 lib="$output_objdir/$realname"
6442 linknames="$linknames $link"
6445 # Use standard objects if they are pic
6446 test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
6447 test "X$libobjs" = "X " && libobjs=
6450 if test -n "$export_symbols" && test -n "$include_expsyms"; then
6451 $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
6452 export_symbols="$output_objdir/$libname.uexp"
6453 delfiles="$delfiles $export_symbols"
6456 orig_export_symbols=
6459 if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
6460 # exporting using user supplied symfile
6461 if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
6462 # and it's NOT already a .def file. Must figure out
6463 # which of the given symbols are data symbols and tag
6464 # them as such. So, trigger use of export_symbols_cmds.
6465 # export_symbols gets reassigned inside the "prepare
6466 # the list of exported symbols" if statement, so the
6467 # include_expsyms logic still works.
6468 orig_export_symbols="$export_symbols"
6470 always_export_symbols=yes
6476 # Prepare the list of exported symbols
6477 if test -z "$export_symbols"; then
6478 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
6479 func_verbose "generating symbol list for \`$libname.la'"
6480 export_symbols="$output_objdir/$libname.exp"
6481 $opt_dry_run || $RM $export_symbols
6482 cmds=$export_symbols_cmds
6483 save_ifs="$IFS"; IFS='~'
6484 for cmd in $cmds; do
6488 len=$func_len_result
6489 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
6490 func_show_eval "$cmd" 'exit $?'
6491 skipped_export=false
6493 # The command line is too long to execute in one step.
6494 func_verbose "using reloadable object file for export list..."
6496 # Break out early, otherwise skipped_export may be
6497 # set to false by a later but shorter cmd.
6502 if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
6503 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
6504 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
6509 if test -n "$export_symbols" && test -n "$include_expsyms"; then
6510 tmp_export_symbols="$export_symbols"
6511 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
6512 $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
6515 if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
6516 # The given exports_symbols file has to be filtered, so filter it.
6517 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
6518 # FIXME: $output_objdir/$libname.filter potentially contains lots of
6519 # 's' commands which not all seds can handle. GNU sed should be fine
6520 # though. Also, the filter scales superlinearly with the number of
6521 # global variables. join(1) would be nice here, but unfortunately
6522 # isn't a blessed tool.
6523 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
6524 delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
6525 export_symbols=$output_objdir/$libname.def
6526 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
6530 for test_deplib in $deplibs; do
6531 case " $convenience " in
6532 *" $test_deplib "*) ;;
6534 tmp_deplibs="$tmp_deplibs $test_deplib"
6538 deplibs="$tmp_deplibs"
6540 if test -n "$convenience"; then
6541 if test -n "$whole_archive_flag_spec" &&
6542 test "$compiler_needs_object" = yes &&
6543 test -z "$libobjs"; then
6544 # extract the archives, so we have objects to list.
6545 # TODO: could optimize this to just extract one archive.
6546 whole_archive_flag_spec=
6548 if test -n "$whole_archive_flag_spec"; then
6549 save_libobjs=$libobjs
6550 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
6551 test "X$libobjs" = "X " && libobjs=
6553 gentop="$output_objdir/${outputname}x"
6554 generated="$generated $gentop"
6556 func_extract_archives $gentop $convenience
6557 libobjs="$libobjs $func_extract_archives_result"
6558 test "X$libobjs" = "X " && libobjs=
6562 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
6563 eval flag=\"$thread_safe_flag_spec\"
6564 linker_flags="$linker_flags $flag"
6567 # Make a backup of the uninstalled library when relinking
6568 if test "$mode" = relink; then
6569 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
6572 # Do each of the archive commands.
6573 if test "$module" = yes && test -n "$module_cmds" ; then
6574 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
6575 eval test_cmds=\"$module_expsym_cmds\"
6576 cmds=$module_expsym_cmds
6578 eval test_cmds=\"$module_cmds\"
6582 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
6583 eval test_cmds=\"$archive_expsym_cmds\"
6584 cmds=$archive_expsym_cmds
6586 eval test_cmds=\"$archive_cmds\"
6591 if test "X$skipped_export" != "X:" &&
6592 func_len " $test_cmds" &&
6593 len=$func_len_result &&
6594 test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
6597 # The command line is too long to link in one step, link piecewise
6598 # or, if using GNU ld and skipped_export is not :, use a linker
6601 # Save the value of $output and $libobjs because we want to
6602 # use them later. If we have whole_archive_flag_spec, we
6603 # want to use save_libobjs as it was before
6604 # whole_archive_flag_spec was expanded, because we can't
6605 # assume the linker understands whole_archive_flag_spec.
6606 # This may have to be revisited, in case too many
6607 # convenience libraries get linked in and end up exceeding
6609 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
6610 save_libobjs=$libobjs
6613 output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
6615 # Clear the reloadable object creation command queue and
6616 # initialize k to one.
6623 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
6624 output=${output_objdir}/${output_la}.lnkscript
6625 func_verbose "creating GNU ld script: $output"
6626 $ECHO 'INPUT (' > $output
6627 for obj in $save_libobjs
6629 $ECHO "$obj" >> $output
6631 $ECHO ')' >> $output
6632 delfiles="$delfiles $output"
6633 elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
6634 output=${output_objdir}/${output_la}.lnk
6635 func_verbose "creating linker input file list: $output"
6640 if test "$compiler_needs_object" = yes; then
6646 $ECHO "$obj" >> $output
6648 delfiles="$delfiles $output"
6649 output=$firstobj\"$file_list_spec$output\"
6651 if test -n "$save_libobjs"; then
6652 func_verbose "creating reloadable object files..."
6653 output=$output_objdir/$output_la-${k}.$objext
6654 eval test_cmds=\"$reload_cmds\"
6655 func_len " $test_cmds"
6656 len0=$func_len_result
6659 # Loop over the list of objects to be linked.
6660 for obj in $save_libobjs
6663 func_arith $len + $func_len_result
6664 len=$func_arith_result
6665 if test "X$objlist" = X ||
6666 test "$len" -lt "$max_cmd_len"; then
6667 func_append objlist " $obj"
6669 # The command $test_cmds is almost too long, add a
6670 # command to the queue.
6671 if test "$k" -eq 1 ; then
6672 # The first file doesn't have a previous command to add.
6673 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
6675 # All subsequent reloadable object files will link in
6676 # the last one created.
6677 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
6679 last_robj=$output_objdir/$output_la-${k}.$objext
6681 k=$func_arith_result
6682 output=$output_objdir/$output_la-${k}.$objext
6684 func_len " $last_robj"
6685 func_arith $len0 + $func_len_result
6686 len=$func_arith_result
6689 # Handle the remaining objects by creating one last
6690 # reloadable object file. All subsequent reloadable object
6691 # files will link in the last one created.
6692 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
6693 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
6694 if test -n "$last_robj"; then
6695 eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
6697 delfiles="$delfiles $output"
6703 if ${skipped_export-false}; then
6704 func_verbose "generating symbol list for \`$libname.la'"
6705 export_symbols="$output_objdir/$libname.exp"
6706 $opt_dry_run || $RM $export_symbols
6708 # Append the command to create the export file.
6709 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
6710 eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
6711 if test -n "$last_robj"; then
6712 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
6716 test -n "$save_libobjs" &&
6717 func_verbose "creating a temporary reloadable object file: $output"
6719 # Loop through the commands generated above and execute them.
6720 save_ifs="$IFS"; IFS='~'
6721 for cmd in $concat_cmds; do
6724 func_quote_for_expand "$cmd"
6725 eval "func_echo $func_quote_for_expand_result"
6727 $opt_dry_run || eval "$cmd" || {
6730 # Restore the uninstalled library and exit
6731 if test "$mode" = relink; then
6732 ( cd "$output_objdir" && \
6733 $RM "${realname}T" && \
6734 $MV "${realname}U" "$realname" )
6742 if test -n "$export_symbols_regex" && ${skipped_export-false}; then
6743 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
6744 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
6748 if ${skipped_export-false}; then
6749 if test -n "$export_symbols" && test -n "$include_expsyms"; then
6750 tmp_export_symbols="$export_symbols"
6751 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
6752 $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
6755 if test -n "$orig_export_symbols"; then
6756 # The given exports_symbols file has to be filtered, so filter it.
6757 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
6758 # FIXME: $output_objdir/$libname.filter potentially contains lots of
6759 # 's' commands which not all seds can handle. GNU sed should be fine
6760 # though. Also, the filter scales superlinearly with the number of
6761 # global variables. join(1) would be nice here, but unfortunately
6762 # isn't a blessed tool.
6763 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
6764 delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
6765 export_symbols=$output_objdir/$libname.def
6766 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
6771 # Restore the value of output.
6774 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
6775 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
6776 test "X$libobjs" = "X " && libobjs=
6778 # Expand the library linking commands again to reset the
6779 # value of $libobjs for piecewise linking.
6781 # Do each of the archive commands.
6782 if test "$module" = yes && test -n "$module_cmds" ; then
6783 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
6784 cmds=$module_expsym_cmds
6789 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
6790 cmds=$archive_expsym_cmds
6797 if test -n "$delfiles"; then
6798 # Append the command to remove temporary files to $cmds.
6799 eval cmds=\"\$cmds~\$RM $delfiles\"
6802 # Add any objects from preloaded convenience libraries
6803 if test -n "$dlprefiles"; then
6804 gentop="$output_objdir/${outputname}x"
6805 generated="$generated $gentop"
6807 func_extract_archives $gentop $dlprefiles
6808 libobjs="$libobjs $func_extract_archives_result"
6809 test "X$libobjs" = "X " && libobjs=
6812 save_ifs="$IFS"; IFS='~'
6813 for cmd in $cmds; do
6817 func_quote_for_expand "$cmd"
6818 eval "func_echo $func_quote_for_expand_result"
6820 $opt_dry_run || eval "$cmd" || {
6823 # Restore the uninstalled library and exit
6824 if test "$mode" = relink; then
6825 ( cd "$output_objdir" && \
6826 $RM "${realname}T" && \
6827 $MV "${realname}U" "$realname" )
6835 # Restore the uninstalled library and exit
6836 if test "$mode" = relink; then
6837 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
6839 if test -n "$convenience"; then
6840 if test -z "$whole_archive_flag_spec"; then
6841 func_show_eval '${RM}r "$gentop"'
6848 # Create links to the real library.
6849 for linkname in $linknames; do
6850 if test "$realname" != "$linkname"; then
6851 func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
6855 # If -module or -export-dynamic was specified, set the dlname.
6856 if test "$module" = yes || test "$export_dynamic" = yes; then
6857 # On all known operating systems, these are identical.
6864 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
6865 func_warning "\`-dlopen' is ignored for objects"
6870 func_warning "\`-l' and \`-L' are ignored for objects" ;;
6873 test -n "$rpath" && \
6874 func_warning "\`-rpath' is ignored for objects"
6876 test -n "$xrpath" && \
6877 func_warning "\`-R' is ignored for objects"
6879 test -n "$vinfo" && \
6880 func_warning "\`-version-info' is ignored for objects"
6882 test -n "$release" && \
6883 func_warning "\`-release' is ignored for objects"
6887 test -n "$objs$old_deplibs" && \
6888 func_fatal_error "cannot build library object \`$output' from non-libtool objects"
6892 obj=$func_lo2o_result
6900 # Delete the old objects.
6901 $opt_dry_run || $RM $obj $libobj
6903 # Objects from convenience libraries. This assumes
6904 # single-version convenience libraries. Whenever we create
6905 # different ones for PIC/non-PIC, this we'll have to duplicate
6909 # reload_cmds runs $LD directly, so let us get rid of
6910 # -Wl from whole_archive_flag_spec and hope we can get by with
6911 # turning comma into space..
6914 if test -n "$convenience"; then
6915 if test -n "$whole_archive_flag_spec"; then
6916 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
6917 reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
6919 gentop="$output_objdir/${obj}x"
6920 generated="$generated $gentop"
6922 func_extract_archives $gentop $convenience
6923 reload_conv_objs="$reload_objs $func_extract_archives_result"
6927 # Create the old-style object.
6928 reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
6931 func_execute_cmds "$reload_cmds" 'exit $?'
6933 # Exit if we aren't doing a library object file.
6934 if test -z "$libobj"; then
6935 if test -n "$gentop"; then
6936 func_show_eval '${RM}r "$gentop"'
6942 if test "$build_libtool_libs" != yes; then
6943 if test -n "$gentop"; then
6944 func_show_eval '${RM}r "$gentop"'
6947 # Create an invalid libtool object if no PIC, so that we don't
6948 # accidentally link it into a program.
6949 # $show "echo timestamp > $libobj"
6950 # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
6954 if test -n "$pic_flag" || test "$pic_mode" != default; then
6955 # Only do commands if we really have different PIC objects.
6956 reload_objs="$libobjs $reload_conv_objs"
6958 func_execute_cmds "$reload_cmds" 'exit $?'
6961 if test -n "$gentop"; then
6962 func_show_eval '${RM}r "$gentop"'
6970 *cygwin*) func_stripname '' '.exe' "$output"
6971 output=$func_stripname_result.exe;;
6973 test -n "$vinfo" && \
6974 func_warning "\`-version-info' is ignored for programs"
6976 test -n "$release" && \
6977 func_warning "\`-release' is ignored for programs"
6979 test "$preload" = yes \
6980 && test "$dlopen_support" = unknown \
6981 && test "$dlopen_self" = unknown \
6982 && test "$dlopen_self_static" = unknown && \
6983 func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
6986 *-*-rhapsody* | *-*-darwin1.[012])
6987 # On Rhapsody replace the C library is the System framework
6988 compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
6989 finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
6995 # Don't allow lazy linking, it breaks C++ global constructors
6996 # But is supposedly fixed on 10.4 or later (yay!).
6997 if test "$tagname" = CXX ; then
6998 case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
7000 compile_command="$compile_command ${wl}-bind_at_load"
7001 finalize_command="$finalize_command ${wl}-bind_at_load"
7005 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
7006 compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
7007 finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
7012 # move library search paths that coincide with paths to not yet
7013 # installed libraries to the beginning of the library search list
7015 for path in $notinst_path; do
7016 case " $new_libs " in
7017 *" -L$path/$objdir "*) ;;
7019 case " $compile_deplibs " in
7020 *" -L$path/$objdir "*)
7021 new_libs="$new_libs -L$path/$objdir" ;;
7026 for deplib in $compile_deplibs; do
7029 case " $new_libs " in
7031 *) new_libs="$new_libs $deplib" ;;
7034 *) new_libs="$new_libs $deplib" ;;
7037 compile_deplibs="$new_libs"
7040 compile_command="$compile_command $compile_deplibs"
7041 finalize_command="$finalize_command $finalize_deplibs"
7043 if test -n "$rpath$xrpath"; then
7044 # If the user specified any rpath flags, then add them.
7045 for libdir in $rpath $xrpath; do
7046 # This is the magic to use -rpath.
7047 case "$finalize_rpath " in
7049 *) finalize_rpath="$finalize_rpath $libdir" ;;
7054 # Now hardcode the library paths
7057 for libdir in $compile_rpath $finalize_rpath; do
7058 if test -n "$hardcode_libdir_flag_spec"; then
7059 if test -n "$hardcode_libdir_separator"; then
7060 if test -z "$hardcode_libdirs"; then
7061 hardcode_libdirs="$libdir"
7063 # Just accumulate the unique libdirs.
7064 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
7065 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
7068 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
7073 eval flag=\"$hardcode_libdir_flag_spec\"
7074 rpath="$rpath $flag"
7076 elif test -n "$runpath_var"; then
7077 case "$perm_rpath " in
7079 *) perm_rpath="$perm_rpath $libdir" ;;
7083 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
7084 testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
7085 case :$dllsearchpath: in
7087 *) dllsearchpath="$dllsearchpath:$libdir";;
7089 case :$dllsearchpath: in
7090 *":$testbindir:"*) ;;
7091 *) dllsearchpath="$dllsearchpath:$testbindir";;
7096 # Substitute the hardcoded libdirs into the rpath.
7097 if test -n "$hardcode_libdir_separator" &&
7098 test -n "$hardcode_libdirs"; then
7099 libdir="$hardcode_libdirs"
7100 eval rpath=\" $hardcode_libdir_flag_spec\"
7102 compile_rpath="$rpath"
7106 for libdir in $finalize_rpath; do
7107 if test -n "$hardcode_libdir_flag_spec"; then
7108 if test -n "$hardcode_libdir_separator"; then
7109 if test -z "$hardcode_libdirs"; then
7110 hardcode_libdirs="$libdir"
7112 # Just accumulate the unique libdirs.
7113 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
7114 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
7117 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
7122 eval flag=\"$hardcode_libdir_flag_spec\"
7123 rpath="$rpath $flag"
7125 elif test -n "$runpath_var"; then
7126 case "$finalize_perm_rpath " in
7128 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
7132 # Substitute the hardcoded libdirs into the rpath.
7133 if test -n "$hardcode_libdir_separator" &&
7134 test -n "$hardcode_libdirs"; then
7135 libdir="$hardcode_libdirs"
7136 eval rpath=\" $hardcode_libdir_flag_spec\"
7138 finalize_rpath="$rpath"
7140 if test -n "$libobjs" && test "$build_old_libs" = yes; then
7141 # Transform all the library objects into standard objects.
7142 compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
7143 finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
7146 func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
7148 # template prelinking step
7149 if test -n "$prelink_cmds"; then
7150 func_execute_cmds "$prelink_cmds" 'exit $?'
7153 wrappers_required=yes
7155 *cygwin* | *mingw* )
7156 if test "$build_libtool_libs" != yes; then
7157 wrappers_required=no
7161 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
7162 wrappers_required=no
7166 if test "$wrappers_required" = no; then
7167 # Replace the output file specification.
7168 compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
7169 link_command="$compile_command$compile_rpath"
7171 # We have no uninstalled library dependencies, so finalize right now.
7173 func_show_eval "$link_command" 'exit_status=$?'
7175 # Delete the generated files.
7176 if test -f "$output_objdir/${outputname}S.${objext}"; then
7177 func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
7183 if test -n "$compile_shlibpath$finalize_shlibpath"; then
7184 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
7186 if test -n "$finalize_shlibpath"; then
7187 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
7192 if test -n "$runpath_var"; then
7193 if test -n "$perm_rpath"; then
7194 # We should set the runpath_var.
7196 for dir in $perm_rpath; do
7199 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
7201 if test -n "$finalize_perm_rpath"; then
7202 # We should set the runpath_var.
7204 for dir in $finalize_perm_rpath; do
7207 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
7211 if test "$no_install" = yes; then
7212 # We don't need to create a wrapper script.
7213 link_command="$compile_var$compile_command$compile_rpath"
7214 # Replace the output file specification.
7215 link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
7216 # Delete the old output file.
7217 $opt_dry_run || $RM $output
7218 # Link the executable and exit
7219 func_show_eval "$link_command" 'exit $?'
7223 if test "$hardcode_action" = relink; then
7224 # Fast installation is not supported
7225 link_command="$compile_var$compile_command$compile_rpath"
7226 relink_command="$finalize_var$finalize_command$finalize_rpath"
7228 func_warning "this platform does not like uninstalled shared libraries"
7229 func_warning "\`$output' will be relinked during installation"
7231 if test "$fast_install" != no; then
7232 link_command="$finalize_var$compile_command$finalize_rpath"
7233 if test "$fast_install" = yes; then
7234 relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
7236 # fast_install is set to needless
7240 link_command="$compile_var$compile_command$compile_rpath"
7241 relink_command="$finalize_var$finalize_command$finalize_rpath"
7245 # Replace the output file specification.
7246 link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
7248 # Delete the old output files.
7249 $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
7251 func_show_eval "$link_command" 'exit $?'
7253 # Now create the wrapper script.
7254 func_verbose "creating $output"
7256 # Quote the relink command for shipping.
7257 if test -n "$relink_command"; then
7258 # Preserve any variables that may affect compiler behavior
7259 for var in $variables_saved_for_relink; do
7260 if eval test -z \"\${$var+set}\"; then
7261 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
7262 elif eval var_value=\$$var; test -z "$var_value"; then
7263 relink_command="$var=; export $var; $relink_command"
7265 func_quote_for_eval "$var_value"
7266 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
7269 relink_command="(cd `pwd`; $relink_command)"
7270 relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
7273 # Quote $ECHO for shipping.
7274 if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
7276 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
7277 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
7279 qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
7281 qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
7284 # Only actually do things if not in dry run mode.
7286 # win32 will think the script is a binary if it has
7287 # a .exe suffix, so we strip it off here.
7289 *.exe) func_stripname '' '.exe' "$output"
7290 output=$func_stripname_result ;;
7292 # test for cygwin because mv fails w/o .exe extensions
7296 func_stripname '' '.exe' "$outputname"
7297 outputname=$func_stripname_result ;;
7301 *cygwin* | *mingw* )
7302 func_dirname_and_basename "$output" "" "."
7303 output_name=$func_basename_result
7304 output_path=$func_dirname_result
7305 cwrappersource="$output_path/$objdir/lt-$output_name.c"
7306 cwrapper="$output_path/$output_name.exe"
7307 $RM $cwrappersource $cwrapper
7308 trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
7310 func_emit_cwrapperexe_src > $cwrappersource
7312 # we should really use a build-platform specific compiler
7313 # here, but OTOH, the wrappers (shell script and this C one)
7314 # are only useful if you want to execute the "real" binary.
7315 # Since the "real" binary is built for $host, then this
7316 # wrapper might as well be built for $host, too.
7318 $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
7322 # Now, create the wrapper script for func_source use:
7323 func_ltwrapper_scriptname $cwrapper
7324 $RM $func_ltwrapper_scriptname_result
7325 trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
7327 # note: this script will not be executed, so do not chmod.
7328 if test "x$build" = "x$host" ; then
7329 $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
7331 func_emit_wrapper no > $func_ltwrapper_scriptname_result
7337 trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
7339 func_emit_wrapper no > $output
7348 # See if we need to build an old-fashioned archive.
7349 for oldlib in $oldlibs; do
7351 if test "$build_libtool_libs" = convenience; then
7352 oldobjs="$libobjs_save $symfileobj"
7353 addlibs="$convenience"
7354 build_libtool_libs=no
7356 if test "$build_libtool_libs" = module; then
7357 oldobjs="$libobjs_save"
7358 build_libtool_libs=no
7360 oldobjs="$old_deplibs $non_pic_objects"
7361 if test "$preload" = yes && test -f "$symfileobj"; then
7362 oldobjs="$oldobjs $symfileobj"
7365 addlibs="$old_convenience"
7368 if test -n "$addlibs"; then
7369 gentop="$output_objdir/${outputname}x"
7370 generated="$generated $gentop"
7372 func_extract_archives $gentop $addlibs
7373 oldobjs="$oldobjs $func_extract_archives_result"
7376 # Do each command in the archive commands.
7377 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
7378 cmds=$old_archive_from_new_cmds
7381 # Add any objects from preloaded convenience libraries
7382 if test -n "$dlprefiles"; then
7383 gentop="$output_objdir/${outputname}x"
7384 generated="$generated $gentop"
7386 func_extract_archives $gentop $dlprefiles
7387 oldobjs="$oldobjs $func_extract_archives_result"
7390 # POSIX demands no paths to be encoded in archives. We have
7391 # to avoid creating archives with duplicate basenames if we
7392 # might have to extract them afterwards, e.g., when creating a
7393 # static archive out of a convenience library, or when linking
7394 # the entirety of a libtool archive into another (currently
7395 # not supported by libtool).
7396 if (for obj in $oldobjs
7398 func_basename "$obj"
7399 $ECHO "$func_basename_result"
7400 done | sort | sort -uc >/dev/null 2>&1); then
7403 $ECHO "copying selected object files to avoid basename conflicts..."
7404 gentop="$output_objdir/${outputname}x"
7405 generated="$generated $gentop"
7406 func_mkdir_p "$gentop"
7407 save_oldobjs=$oldobjs
7410 for obj in $save_oldobjs
7412 func_basename "$obj"
7413 objbase="$func_basename_result"
7414 case " $oldobjs " in
7415 " ") oldobjs=$obj ;;
7418 # Make sure we don't pick an alternate name that also
7420 newobj=lt$counter-$objbase
7421 func_arith $counter + 1
7422 counter=$func_arith_result
7423 case " $oldobjs " in
7424 *[\ /]"$newobj "*) ;;
7425 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
7428 func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
7429 oldobjs="$oldobjs $gentop/$newobj"
7431 *) oldobjs="$oldobjs $obj" ;;
7435 eval cmds=\"$old_archive_cmds\"
7438 len=$func_len_result
7439 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7440 cmds=$old_archive_cmds
7442 # the command line is too long to link in one step, link in parts
7443 func_verbose "using piecewise archive linking..."
7448 save_oldobjs=$oldobjs
7450 # Is there a better way of finding the last object in the list?
7451 for obj in $save_oldobjs
7455 eval test_cmds=\"$old_archive_cmds\"
7456 func_len " $test_cmds"
7457 len0=$func_len_result
7459 for obj in $save_oldobjs
7462 func_arith $len + $func_len_result
7463 len=$func_arith_result
7464 func_append objlist " $obj"
7465 if test "$len" -lt "$max_cmd_len"; then
7468 # the above command should be used before it gets too long
7470 if test "$obj" = "$last_oldobj" ; then
7473 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
7474 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
7481 if test "X$oldobjs" = "X" ; then
7482 eval cmds=\"\$concat_cmds\"
7484 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
7488 func_execute_cmds "$cmds" 'exit $?'
7491 test -n "$generated" && \
7492 func_show_eval "${RM}r$generated"
7494 # Now create the libtool archive.
7498 test "$build_old_libs" = yes && old_library="$libname.$libext"
7499 func_verbose "creating $output"
7501 # Preserve any variables that may affect compiler behavior
7502 for var in $variables_saved_for_relink; do
7503 if eval test -z \"\${$var+set}\"; then
7504 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
7505 elif eval var_value=\$$var; test -z "$var_value"; then
7506 relink_command="$var=; export $var; $relink_command"
7508 func_quote_for_eval "$var_value"
7509 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
7512 # Quote the link command for shipping.
7513 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
7514 relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
7515 if test "$hardcode_automatic" = yes ; then
7519 # Only create the output if not a dry run.
7521 for installed in no yes; do
7522 if test "$installed" = yes; then
7523 if test -z "$install_libdir"; then
7526 output="$output_objdir/$outputname"i
7527 # Replace all uninstalled libtool libraries with the installed ones
7529 for deplib in $dependency_libs; do
7532 func_basename "$deplib"
7533 name="$func_basename_result"
7534 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
7535 test -z "$libdir" && \
7536 func_fatal_error "\`$deplib' is not a valid libtool archive"
7537 if test "x$EGREP" = x ; then
7540 # We do not want portage's install root ($D) present. Check only for
7541 # this if the .la is being installed.
7542 if test "$installed" = yes && test "$D"; then
7543 eval mynewdependency_lib=`echo "$libdir/$name" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
7545 mynewdependency_lib="$libdir/$name"
7547 # Do not add duplicates
7548 if test "$mynewdependency_lib"; then
7549 my_little_ninja_foo_1=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"`
7550 if test -z "$my_little_ninja_foo_1"; then
7551 newdependency_libs="$newdependency_libs $mynewdependency_lib"
7556 if test "$installed" = yes; then
7557 # Rather use S=WORKDIR if our version of portage supports it.
7558 # This is because some ebuild (gcc) do not use $S as buildroot.
7559 if test "$PWORKDIR"; then
7562 # We do not want portage's build root ($S) present.
7563 my_little_ninja_foo_2=`echo $deplib |$EGREP -e "$S"`
7564 # We do not want portage's install root ($D) present.
7565 my_little_ninja_foo_3=`echo $deplib |$EGREP -e "$D"`
7566 if test -n "$my_little_ninja_foo_2" && test "$S"; then
7567 mynewdependency_lib=""
7568 elif test -n "$my_little_ninja_foo_3" && test "$D"; then
7569 eval mynewdependency_lib=`echo "$deplib" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
7571 mynewdependency_lib="$deplib"
7574 mynewdependency_lib="$deplib"
7576 # Do not add duplicates
7577 if test "$mynewdependency_lib"; then
7578 my_little_ninja_foo_4=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"`
7579 if test -z "$my_little_ninja_foo_4"; then
7580 newdependency_libs="$newdependency_libs $mynewdependency_lib"
7586 dependency_libs="$newdependency_libs"
7589 for lib in $dlfiles; do
7592 func_basename "$lib"
7593 name="$func_basename_result"
7594 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
7595 test -z "$libdir" && \
7596 func_fatal_error "\`$lib' is not a valid libtool archive"
7597 newdlfiles="$newdlfiles $libdir/$name"
7599 *) newdlfiles="$newdlfiles $lib" ;;
7602 dlfiles="$newdlfiles"
7604 for lib in $dlprefiles; do
7607 # Only pass preopened files to the pseudo-archive (for
7608 # eventual linking with the app. that links it) if we
7609 # didn't already link the preopened objects directly into
7611 func_basename "$lib"
7612 name="$func_basename_result"
7613 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
7614 test -z "$libdir" && \
7615 func_fatal_error "\`$lib' is not a valid libtool archive"
7616 newdlprefiles="$newdlprefiles $libdir/$name"
7620 dlprefiles="$newdlprefiles"
7623 for lib in $dlfiles; do
7625 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
7626 *) abs=`pwd`"/$lib" ;;
7628 newdlfiles="$newdlfiles $abs"
7630 dlfiles="$newdlfiles"
7632 for lib in $dlprefiles; do
7634 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
7635 *) abs=`pwd`"/$lib" ;;
7637 newdlprefiles="$newdlprefiles $abs"
7639 dlprefiles="$newdlprefiles"
7642 # place dlname in correct position for cygwin
7644 case $host,$output,$installed,$module,$dlname in
7645 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
7647 # Do not add duplicates
7648 if test "$installed" = yes && test "$D"; then
7649 install_libdir=`echo "$install_libdir" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
7652 # $outputname - a libtool library file
7653 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
7655 # Please DO NOT delete this file!
7656 # It is necessary for linking the library.
7658 # The name that we can dlopen(3).
7661 # Names of this library.
7662 library_names='$library_names'
7664 # The name of the static archive.
7665 old_library='$old_library'
7667 # Linker flags that can not go in dependency_libs.
7668 inherited_linker_flags='$new_inherited_linker_flags'
7670 # Libraries that this one depends upon.
7671 dependency_libs='$dependency_libs'
7673 # Names of additional weak libraries provided by this library
7674 weak_library_names='$weak_libs'
7676 # Version information for $libname.
7681 # Is this an already installed library?
7682 installed=$installed
7684 # Should we warn about portability when linking against -modules?
7685 shouldnotlink=$module
7687 # Files to dlopen/dlpreopen
7689 dlpreopen='$dlprefiles'
7691 # Directory that this library needs to be installed in:
7692 libdir='$install_libdir'"
7693 if test "$installed" = no && test "$need_relink" = yes; then
7695 relink_command=\"$relink_command\""
7700 # Do a symbolic link so that the libtool archive can be found in
7701 # LD_LIBRARY_PATH before the program is installed.
7702 func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
7708 { test "$mode" = link || test "$mode" = relink; } &&
7709 func_mode_link ${1+"$@"}
7712 # func_mode_uninstall arg...
7713 func_mode_uninstall ()
7721 # This variable tells wrapper scripts just to set variables rather
7722 # than running their programs.
7723 libtool_install_magic="$magic"
7728 -f) RM="$RM $arg"; rmforce=yes ;;
7729 -*) RM="$RM $arg" ;;
7730 *) files="$files $arg" ;;
7735 func_fatal_help "you must specify an RM program"
7739 origobjdir="$objdir"
7740 for file in $files; do
7741 func_dirname "$file" "" "."
7742 dir="$func_dirname_result"
7743 if test "X$dir" = X.; then
7744 objdir="$origobjdir"
7746 objdir="$dir/$origobjdir"
7748 func_basename "$file"
7749 name="$func_basename_result"
7750 test "$mode" = uninstall && objdir="$dir"
7752 # Remember objdir for removal later, being careful to avoid duplicates
7753 if test "$mode" = clean; then
7756 *) rmdirs="$rmdirs $objdir" ;;
7760 # Don't error if the file doesn't exist and rm -f was used.
7761 if { test -L "$file"; } >/dev/null 2>&1 ||
7762 { test -h "$file"; } >/dev/null 2>&1 ||
7763 test -f "$file"; then
7765 elif test -d "$file"; then
7768 elif test "$rmforce" = yes; then
7776 # Possibly a libtool archive, so verify it.
7777 if func_lalib_p "$file"; then
7778 func_source $dir/$name
7780 # Delete the libtool libraries and symlinks.
7781 for n in $library_names; do
7782 rmfiles="$rmfiles $objdir/$n"
7784 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
7788 case " $library_names " in
7789 # " " in the beginning catches empty $dlname
7791 *) rmfiles="$rmfiles $objdir/$dlname" ;;
7793 test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
7796 if test -n "$library_names"; then
7797 # Do each command in the postuninstall commands.
7798 func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
7801 if test -n "$old_library"; then
7802 # Do each command in the old_postuninstall commands.
7803 func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
7805 # FIXME: should reinstall the best remaining shared library.
7812 # Possibly a libtool object, so verify it.
7813 if func_lalib_p "$file"; then
7816 func_source $dir/$name
7818 # Add PIC object to the list of files to remove.
7819 if test -n "$pic_object" &&
7820 test "$pic_object" != none; then
7821 rmfiles="$rmfiles $dir/$pic_object"
7824 # Add non-PIC object to the list of files to remove.
7825 if test -n "$non_pic_object" &&
7826 test "$non_pic_object" != none; then
7827 rmfiles="$rmfiles $dir/$non_pic_object"
7833 if test "$mode" = clean ; then
7837 func_stripname '' '.exe' "$file"
7838 file=$func_stripname_result
7839 func_stripname '' '.exe' "$name"
7840 noexename=$func_stripname_result
7841 # $file with .exe has already been added to rmfiles,
7842 # add $file without .exe
7843 rmfiles="$rmfiles $file"
7846 # Do a test to see if this is a libtool program.
7847 if func_ltwrapper_p "$file"; then
7848 if func_ltwrapper_executable_p "$file"; then
7849 func_ltwrapper_scriptname "$file"
7851 func_source $func_ltwrapper_scriptname_result
7852 rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
7855 func_source $dir/$noexename
7858 # note $name still contains .exe if it was in $file originally
7859 # as does the version of $file that was added into $rmfiles
7860 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
7861 if test "$fast_install" = yes && test -n "$relink_command"; then
7862 rmfiles="$rmfiles $objdir/lt-$name"
7864 if test "X$noexename" != "X$name" ; then
7865 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
7871 func_show_eval "$RM $rmfiles" 'exit_status=1'
7873 objdir="$origobjdir"
7875 # Try to remove the ${objdir}s in the directories where we deleted files
7876 for dir in $rmdirs; do
7877 if test -d "$dir"; then
7878 func_show_eval "rmdir $dir >/dev/null 2>&1"
7885 { test "$mode" = uninstall || test "$mode" = clean; } &&
7886 func_mode_uninstall ${1+"$@"}
7888 test -z "$mode" && {
7889 help="$generic_help"
7890 func_fatal_help "you must specify a MODE"
7893 test -z "$exec_cmd" && \
7894 func_fatal_help "invalid operation mode \`$mode'"
7896 if test -n "$exec_cmd"; then
7897 eval exec "$exec_cmd"
7904 # The TAGs below are defined such that we never get into a situation
7905 # in which we disable both kinds of libraries. Given conflicting
7906 # choices, we go for a static library, that is the most portable,
7907 # since we can't tell whether shared libraries were disabled because
7908 # the user asked for that or because the platform doesn't support
7909 # them. This is particularly important on AIX, because we don't
7910 # support having both static and shared libraries enabled at the same
7911 # time on that platform, so we default to a shared-only configuration.
7912 # If a disable-shared tag is given, we'll fallback to a static-only
7913 # configuration. But we'll never go from static-only to shared-only.
7915 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
7916 build_libtool_libs=no
7918 # ### END LIBTOOL TAG CONFIG: disable-shared
7920 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
7921 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
7922 # ### END LIBTOOL TAG CONFIG: disable-static