1 # Generated from ltmain.m4sh; do not edit by hand
3 # ltmain.sh (GNU libtool 1.2248 2006/01/21 17:40:19) 2.1a
4 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
6 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006
7 # Free Software Foundation, Inc.
8 # This is free software; see the source for copying conditions. There is NO
9 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; either version 2 of the License, or
14 # (at your option) any later version.
16 # This program is distributed in the hope that it will be useful, but
17 # WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 # General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 # As a special exception to the GNU General Public License, if you
26 # distribute this file as part of a program that contains a
27 # configuration script generated by Autoconf, you may include it under
28 # the same distribution terms that you use for the rest of that program.
30 # Usage: $progname [OPTION]... [MODE-ARG]...
32 # Provide generalized library-building support services.
34 # --config show all configuration variables
35 # --debug enable verbose shell tracing
36 # -n, --dry-run display commands without modifying any files
37 # --features display basic configuration information and exit
38 # --mode=MODE use operation mode MODE
39 # --preserve-dup-deps don't remove duplicate dependency libraries
40 # --quiet, --silent don't print informational messages
41 # --tag=TAG use configuration variables from tag TAG
42 # -v, --verbose print informational messages (default)
43 # --version print version information
44 # -h, --help print short or long help message
46 # MODE must be one of the following:
48 # clean remove files from the build directory
49 # compile compile a source file into a libtool object
50 # execute automatically set library path, then run a program
51 # finish complete the installation of libtool libraries
52 # install install libraries or executables
53 # link create a library or an executable
54 # uninstall remove libraries from an installed directory
56 # MODE-ARGS vary depending on the MODE.
57 # Try `$progname --help --mode=MODE' for a more detailed description of MODE.
59 # When reporting a bug, please describe a test case to reproduce it and
60 # include the following information:
62 # host-triplet: powerpc-apple-darwin8.2.0
65 # compiler flags: $LTCFLAGS
66 # linker: $LD (gnu? $with_gnu_ld)
67 # $progname: (GNU libtool 1.2248 2006/01/21 17:40:19) 2.1a
68 # automake: $automake_version
69 # autoconf: $autoconf_version
71 # Report bugs to <bug-libtool@gnu.org>.
76 TIMESTAMP
=" 1.2248 2006/01/21 17:40:19"
77 package_revision
=1.2248
79 ## --------------------- ##
80 ## M4sh Initialization. ##
81 ## --------------------- ##
83 # Be Bourne compatible
84 if test -n "${ZSH_VERSION+set}" && (emulate sh
) >/dev
/null
2>&1; then
87 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
88 # is contrary to our usage. Disable this feature.
89 alias -g '${1+"$@"}'='"$@"'
90 elif test -n "${BASH_VERSION+set}" && (set -o posix
) >/dev
/null
2>&1; then
93 DUALCASE
=1; export DUALCASE
# for MKS sh
95 # Support unset when possible.
96 if ( (MAIL
=60; unset MAIL
) || exit) >/dev
/null
2>&1; then
103 # Work around bugs in pre-3.0 UWIN ksh.
104 $as_unset ENV MAIL MAILPATH
111 LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
112 LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
115 if (set +x
; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
116 eval $as_var=C
; export $as_var
122 # Required to use basename.
123 if expr a
: '\(a\)' >/dev
/null
2>&1; then
129 if (basename /) >/dev
/null
2>&1 && test "X`basename / 2>&1`" = "X/"; then
136 # Name of the executable.
137 as_me
=`$as_basename "$0" ||
138 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
139 X"$0" : 'X\(//\)$' \| \
140 X"$0" : 'X\(/\)$' \| \
141 . : '\(.\)' 2>/dev/null ||
143 sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
144 /^X\/\(\/\/\)$/{ s//\1/; q; }
145 /^X\/\(\/\).*/{ s//\1/; q; }
163 : ${SED="/usr/bin/sed"}
164 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
165 : ${Xsed="$SED -e 1s/^X//"}
170 EXIT_MISMATCH
=63 # $? = 63 is used to indicate version mismatch to missing.
171 EXIT_SKIP
=77 # $? = 77 is used to indicate a skipped test to automake.
173 exit_status
=$EXIT_SUCCESS
175 # Make sure IFS has a sensible default
180 dirname="s,/[^/]*$,,"
183 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
184 # is ksh but when the shell is invoked as "sh" and the current value of
185 # the _XPG environment variable is not equal to 1 (one), the special
186 # positional parameter $0, within a function call, is the name of the
190 # The name of this program:
191 # In the unlikely event $progname began with a '-', it would play havoc with
192 # func_echo (imagine progname=-n), so we prepend ./ in that case:
193 progname
=`$ECHO "X$progpath" | $Xsed -e "$basename" -e 's,^-,./-,'`
195 # Make sure we have an absolute path for reexecution:
197 [\\/]*|[A
-Za-z]:\\*) ;;
199 progdir
=`$ECHO "X$progpath" | $Xsed -e "$dirname"`
200 progdir
=`cd "$progdir" && pwd`
201 progpath
="$progdir/$progname"
206 for progdir
in $PATH; do
208 test -x "$progdir/$progname" && break
211 test -n "$progdir" || progdir
=`pwd`
212 progpath
="$progdir/$progname"
216 # Sed substitution that helps us do robust quoting. It backslashifies
217 # metacharacters that are still active within double-quoted strings.
218 Xsed
="${SED}"' -e 1s/^X//'
219 sed_quote_subst
='s/\([`"$\\]\)/\\\1/g'
221 # Same as above, but do not quote variable references.
222 double_quote_subst
='s/\(["`\\]\)/\\\1/g'
224 # Re-`\' parameter expansions in output of double_quote_subst that were
225 # `\'-ed in input to the same. If an odd number of `\' preceded a '$'
226 # in input to double_quote_subst, that '$' was protected from expansion.
227 # Since each input `\' is now two `\'s, look for any number of runs of
228 # four `\'s followed by two `\'s and then a '$'. `\' that '$'. Note
229 # that the embedded single quotes serve only to enhance readability.
230 sed_double_backslash
='s/^\(\(''\\\\''\\\\''\)*''\\\\''\)\$/\1\\$/;
231 s/\([^\\]\(''\\\\''\\\\''\)*''\\\\''\)\$/\1\\$/g'
233 # test EBCDIC or ASCII
234 case `echo X|tr X '\101'` in
235 A
) # ASCII based system
236 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
238 NL2SP
='tr \015\012 \040\040'
240 *) # EBCDIC based system
242 NL2SP
='tr \r\n \100\100'
253 # Echo program name prefixed message, along with the current mode
254 # name if it has been set yet.
257 $ECHO "$progname${mode+: }$mode: "${1+"$@"}
260 # func_verbose arg...
261 # Echo program name prefixed message in verbose mode only.
264 $opt_verbose && func_echo
${1+"$@"}
266 # A bug in bash halts the script if the last line of a function
267 # fails when set -e is in force, so we need another command to
273 # Echo program name prefixed message to standard error.
276 $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
279 # func_warning arg...
280 # Echo program name prefixed warning message to standard error.
283 $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
286 # func_fatal_error arg...
287 # Echo program name prefixed message to standard error, and exit.
294 # func_fatal_help arg...
295 # Echo program name prefixed message to standard error, followed by
296 # a help hint, and exit.
300 func_fatal_error
"$help"
302 help="Try \`$progname --help' for more information." ## default
305 # func_grep expression filename
306 # Check whether EXPRESSION matches any line of FILENAME, without output.
309 $GREP "$1" "$2" >/dev
/null
2>&1
313 # func_mkdir_p directory-path
314 # Make sure the entire path to DIRECTORY-PATH is available.
317 my_directory_path
="$1"
320 if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
322 # Protect directory names starting with `-'
323 case $my_directory_path in
324 -*) my_directory_path
="./$my_directory_path" ;;
327 # While some portion of DIR does not yet exist...
328 while test ! -d "$my_directory_path"; do
329 # ...make a list in topmost first order. Use a colon delimited
330 # list incase some portion of path contains whitespace.
331 my_dir_list
="$my_directory_path:$my_dir_list"
333 # If the last portion added has no slash in it, the list is done
334 case $my_directory_path in */*) ;; *) break ;; esac
336 # ...otherwise throw away the child directory and loop
337 my_directory_path
=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
339 my_dir_list
=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
341 save_mkdir_p_IFS
="$IFS"; IFS
=':'
342 for my_dir
in $my_dir_list; do
343 IFS
="$save_mkdir_p_IFS"
344 # mkdir can fail with a `File exist' error if two processes
345 # try to create one of the directories concurrently. Don't
347 $MKDIR "$my_dir" 2>/dev
/null
|| :
349 IFS
="$save_mkdir_p_IFS"
351 # Bail out if we (or some other process) failed to create a directory.
352 test -d "$my_directory_path" || \
353 func_fatal_error
"Failed to create \`$1'"
358 # func_mktempdir [string]
359 # Make a temporary directory that won't clash with other running
360 # libtool processes, and avoids race conditions if possible. If
361 # given, STRING is the basename for that directory.
364 my_template
="${TMPDIR-/tmp}/${1-$progname}"
366 if test "$opt_dry_run" = ":"; then
367 # Return a directory name, but don't create it in dry-run mode
368 my_tmpdir
="${my_template}-$$"
371 # If mktemp works, use that first and foremost
372 my_tmpdir
=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
374 if test ! -d "$my_tmpdir"; then
375 # Failing that, at least try and use $RANDOM to avoid a race
376 my_tmpdir
="${my_template}-${RANDOM-0}$$"
378 save_mktempdir_umask
=`umask`
381 umask $save_mktempdir_umask
384 # If we're not in dry-run mode, bomb out on failure
385 test -d "$my_tmpdir" || \
386 func_fatal_error
"cannot create temporary directory \`$my_tmpdir'"
389 $ECHO "X$my_tmpdir" | $Xsed
393 # func_quote_for_eval arg
394 # Aesthetically quote ARG to be evaled later.
395 # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
396 # is double-quoted, suitable for a subsequent eval, whereas
397 # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
398 # which are still active within double quotes backslashified.
399 func_quote_for_eval
()
403 func_quote_for_eval_unquoted_result
=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
405 func_quote_for_eval_unquoted_result
="$1" ;;
408 case $func_quote_for_eval_unquoted_result in
409 # Double-quote args containing shell metacharacters to delay
410 # word splitting, command substitution and and variable
411 # expansion for a subsequent eval.
412 # Many Bourne shells cannot handle close brackets correctly
413 # in scan sets, so we specify it separately.
414 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
415 func_quote_for_eval_result
="\"$func_quote_for_eval_unquoted_result\""
418 func_quote_for_eval_result
="$func_quote_for_eval_unquoted_result"
423 # func_quote_for_expand arg
424 # Aesthetically quote ARG to be evaled later; same as above,
425 # but do not quote variable references.
426 func_quote_for_expand
()
430 my_arg
=`$ECHO "X$1" | $Xsed \
431 -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
437 # Double-quote args containing shell metacharacters to delay
438 # word splitting and command substitution for a subsequent eval.
439 # Many Bourne shells cannot handle close brackets correctly
440 # in scan sets, so we specify it separately.
441 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
446 func_quote_for_expand_result
="$my_arg"
450 # func_show_eval cmd [fail_exp]
451 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
452 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
453 # is given, then evaluate it.
459 ${opt_silent-false} || {
460 func_quote_for_expand
"$my_cmd"
461 eval "func_echo $func_quote_for_expand_result"
464 if ${opt_dry_run-false}; then :; else
467 if test "$my_status" -eq 0; then :; else
468 eval "(exit $my_status); $my_fail_exp"
475 # Echo version message to standard output and exit.
478 $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
481 s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
488 # Echo short help message to standard output and exit.
491 $SED -n '/^# Usage:/,/# -h/ {
494 s/\$progname/'$progname'/
498 $ECHO "run \`$progname --help | more' for full usage"
503 # Echo long help message to standard output and exit.
506 $SED -n '/^# Usage:/,/# Report bugs to/ {
509 s*\$progname*'$progname'*
510 s*\$SHELL*'"$SHELL"'*
512 s*\$LTCFLAGS*'"$LTCFLAGS"'*
514 s/\$with_gnu_ld/'"$with_gnu_ld"'/
515 s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
516 s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
522 # func_missing_arg argname
523 # Echo program name prefixed message to standard error and set global
527 func_error
"missing argument for $1"
534 # Check that we have a working $ECHO.
535 if test "X$1" = X
--no-reexec; then
536 # Discard the --no-reexec flag, and continue.
538 elif test "X$1" = X
--fallback-echo; then
539 # Avoid inline document here, it may be left over
541 elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
542 # Yippee, $ECHO works!
545 # Restart under the correct shell, and then maybe $ECHO will work.
546 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
549 if test "X$1" = X
--fallback-echo; then
550 # used as fallback echo
558 magic
="%%%MAGIC variable%%%"
566 lo2o
="s/\\.lo\$/.${objext}/"
567 o2lo
="s/\\.${objext}\$/.lo/"
570 opt_duplicate_deps
=false
574 # If this variable is set in any of the actions, the command in it
575 # will be execed at the end. This prevents here-documents from being
576 # left over by shells.
579 # func_fatal_configuration arg...
580 # Echo program name prefixed message to standard error, followed by
581 # a configuration failure hint, and exit.
582 func_fatal_configuration
()
585 func_error
"See the $PACKAGE documentation for more information."
586 func_fatal_error
"Fatal configuration error."
591 # Display the configuration for all the tags in this script.
594 re_begincf
='^# ### BEGIN LIBTOOL'
595 re_endcf
='^# ### END LIBTOOL'
597 # Default configuration.
598 $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
600 # Now print the configurations for the tags.
601 for tagname
in $taglist; do
602 $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
609 # Display the features supported by this script.
613 if test "$build_libtool_libs" = yes; then
614 $ECHO "enable shared libraries"
616 $ECHO "disable shared libraries"
618 if test "$build_old_libs" = yes; then
619 $ECHO "enable static libraries"
621 $ECHO "disable static libraries"
627 # func_enable_tag tagname
628 # Verify that TAGNAME is valid, and either flag an error and exit, or
629 # enable the TAGNAME tag. We also add TAGNAME to the global $taglist
636 re_begincf
="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
637 re_endcf
="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
638 sed_extractcf
="/$re_begincf/,/$re_endcf/p"
643 func_fatal_error
"invalid tag name: $tagname"
647 # Don't test for the "default" C tag, as we know it's
648 # there but not specially marked.
652 if $GREP "$re_begincf" "$progpath" >/dev
/null
2>&1; then
653 taglist
="$taglist $tagname"
655 # Evaluate the configuration. Be careful to quote the path
656 # and the sed script, to avoid splitting on whitespace, but
657 # also don't use non-portable quotes within backquotes within
658 # quotes we have to do it in 2 steps:
659 extractedcf
=`$SED -n -e "$sed_extractcf" < "$progpath"`
662 func_error
"ignoring unknown tag $tagname"
671 # We need to display help for each of the modes.
674 # Generic help is extracted from the usage comments
675 # at the start of this file.
681 "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
683 Remove files from the build directory.
685 RM is the name of the program to use to delete files associated with each FILE
686 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
689 If FILE is a libtool library, object or program, all the files associated
690 with it are deleted. Otherwise, only FILE itself is deleted using RM."
695 "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
697 Compile a source file into a libtool library object.
699 This mode accepts the following additional options:
701 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
702 -no-suppress do not suppress compiler output for multiple passes
703 -prefer-pic try to building PIC objects only
704 -prefer-non-pic try to building non-PIC objects only
705 -shared do not build a \`.o' file suitable for static linking
706 -static only build a \`.o' file suitable for static linking
708 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
709 from the given SOURCEFILE.
711 The output file name is determined by removing the directory component from
712 SOURCEFILE, then substituting the C source code suffix \`.c' with the
713 library object suffix, \`.lo'."
718 "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
720 Automatically set library path, then run a program.
722 This mode accepts the following additional options:
724 -dlopen FILE add the directory containing FILE to the library path
726 This mode sets the library path environment variable according to \`-dlopen'
729 If any of the ARGS are libtool executable wrappers, then they are translated
730 into their corresponding uninstalled binary, and any of their required library
731 directories are added to the library path.
733 Then, COMMAND is executed, with ARGS as arguments."
738 "Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
740 Complete the installation of libtool libraries.
742 Each LIBDIR is a directory that contains libtool libraries.
744 The commands that this mode executes may require superuser privileges. Use
745 the \`--dry-run' option if you just want to see what would be executed."
750 "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
752 Install executables or libraries.
754 INSTALL-COMMAND is the installation command. The first component should be
755 either the \`install' or \`cp' program.
757 The following components of INSTALL-COMMAND are treated specially:
759 -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation
761 The rest of the components are interpreted as arguments to that command (only
762 BSD-compatible install options are recognized)."
767 "Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
769 Link object files or libraries together to form another library, or to
770 create an executable program.
772 LINK-COMMAND is a command using the C compiler that you would use to create
773 a program from several object files.
775 The following components of LINK-COMMAND are treated specially:
777 -all-static do not do any dynamic linking at all
778 -avoid-version do not add a version suffix if possible
779 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
780 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
781 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
782 -export-symbols SYMFILE
783 try to export only the symbols listed in SYMFILE
784 -export-symbols-regex REGEX
785 try to export only the symbols matching REGEX
786 -LLIBDIR search LIBDIR for required installed libraries
787 -lNAME OUTPUT-FILE requires the installed library libNAME
788 -module build a library that can dlopened
789 -no-fast-install disable the fast-install mode
790 -no-install link a not-installable executable
791 -no-undefined declare that a library does not refer to external symbols
792 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
793 -objectlist FILE Use a list of object files found in FILE to specify objects
794 -precious-files-regex REGEX
795 don't remove output files matching REGEX
796 -release RELEASE specify package release information
797 -rpath LIBDIR the created library will eventually be installed in LIBDIR
798 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
799 -shared only do dynamic linking of libtool libraries
800 -shrext SUFFIX override the standard shared library file extension
801 -static do not do any dynamic linking of libtool libraries
802 -version-info CURRENT[:REVISION[:AGE]]
803 specify library version info [each variable defaults to 0]
804 -weak LIBNAME declare that the target provides the LIBNAME interface
806 All other options (arguments beginning with \`-') are ignored.
808 Every other argument is treated as a filename. Files ending in \`.la' are
809 treated as uninstalled libtool libraries, other files are standard or library
812 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
813 only library objects (\`.lo' files) may be specified, and \`-rpath' is
814 required, except when creating a convenience library.
816 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
817 using \`ar' and \`ranlib', or on Windows using \`lib'.
819 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
820 is created, otherwise an executable program is created."
825 "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
827 Remove libraries from an installation directory.
829 RM is the name of the program to use to delete files associated with each FILE
830 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
833 If FILE is a libtool library, all the files associated with it are deleted.
834 Otherwise, only FILE itself is deleted using RM."
838 func_fatal_help
"invalid operation mode \`$mode'"
843 $ECHO "Try \`$progname --help' for more information about other modes."
848 # TEST SUITE MARKER ## NON-FUNCTION
849 # Parse options once, thoroughly. This comes as soon as possible in
850 # the script to make things like `libtool --version' happen quickly.
853 my_sed_single_opt
='1s/^\(..\).*$/\1/;q'
854 my_sed_single_rest
='1s/^..\(.*\)$/\1/;q'
855 my_sed_long_opt
='1s/^\(-[^=]*\)=.*/\1/;q'
856 my_sed_long_arg
='1s/^-[^=]*=//'
858 # Shorthand for --mode=foo, only valid as the first argument
861 shift; set dummy
--mode clean
${1+"$@"}; shift
863 compile
|compil
|compi
|comp
|com
|co
|c
)
864 shift; set dummy
--mode compile
${1+"$@"}; shift
866 execute
|execut
|execu
|exec|exe
|ex
|e
)
867 shift; set dummy
--mode execute
${1+"$@"}; shift
869 finish
|finis
|fini
|fin
|fi|f
)
870 shift; set dummy
--mode finish
${1+"$@"}; shift
872 install|instal
|insta
|inst
|ins
|in|i
)
873 shift; set dummy
--mode install ${1+"$@"}; shift
876 shift; set dummy
--mode link
${1+"$@"}; shift
878 uninstall
|uninstal
|uninsta
|uninst
|unins
|unin
|uni
|un
|u
)
879 shift; set dummy
--mode uninstall
${1+"$@"}; shift
883 # Parse non-mode specific arguments:
884 while test "$#" -gt 0; do
889 --config) func_config
;;
891 --debug) preserve_args
="$preserve_args $opt"
892 func_echo
"enabling shell trace mode"
897 -dlopen) test "$#" -eq 0 && func_missing_arg
"$opt" && break
898 execute_dlfiles
="$execute_dlfiles $1"
902 --dry-run | -n) opt_dry_run
=: ;;
903 --features) func_features
;;
904 --finish) mode
="finish" ;;
906 --mode) test "$#" -eq 0 && func_missing_arg
"$opt" && break
908 # Valid mode arguments:
918 # Catch anything else as an error
919 *) func_error
"invalid argument for $opt"
930 opt_duplicate_deps
=: ;;
932 --quiet|--silent) preserve_args
="$preserve_args $opt"
936 --verbose| -v) preserve_args
="$preserve_args $opt"
940 --tag) test "$#" -eq 0 && func_missing_arg
"$opt" && break
941 preserve_args
="$preserve_args $opt $1"
942 func_enable_tag
"$1" # tagname is set here
946 # Separate optargs to long options:
947 -dlopen=*|--mode=*|--tag=*)
948 arg
=`$ECHO "X$opt" | $Xsed -e "$my_sed_long_arg"`
949 opt
=`$ECHO "X$opt" | $Xsed -e "$my_sed_long_opt"`
950 set dummy
"$opt" "$arg" ${1+"$@"}
954 # Separate optargs to short options:
956 # arg=`$ECHO "X$opt" |$Xsed -e "$my_sed_single_rest"`
957 # opt=`$ECHO "X$opt" |$Xsed -e "$my_sed_single_opt"`
958 # set dummy "$opt" "$arg" ${1+"$@"}
962 # Separate non-argument short options:
964 # rest=`$ECHO "X$opt" |$Xsed -e "$my_sed_single_rest"`
965 # opt=`$ECHO "X$opt" |$Xsed -e "$my_sed_single_opt"`
966 # set dummy "$opt" "-$rest" ${1+"$@"}
970 -\?|-h) func_usage
;;
971 --help) opt_help
=: ;;
972 --version) func_version
;;
974 -*) func_fatal_help
"unrecognized option \`$opt'" ;;
982 # Now that we've collected a possible --mode arg, show help if necessary
983 $opt_help && func_mode_help
986 *cygwin
* | *mingw
* | *pw32
*)
987 # don't eliminate duplications in $postdeps and $predeps
988 opt_duplicate_compiler_generated_deps
=:
991 opt_duplicate_compiler_generated_deps
=$opt_duplicate_deps
995 # Having warned about all mis-specified options, bail out if
996 # anything was wrong.
997 $exit_cmd $EXIT_FAILURE
999 # TEST SUITE MARKER ## BEGIN SOURCABLE
1001 # func_check_version_match
1002 # Ensure that we are using m4 macros, and libtool script from the same
1003 # release of libtool.
1004 func_check_version_match
()
1006 if test "$package_revision" != "$macro_revision"; then
1007 if test "$VERSION" != "$macro_version"; then
1008 if test -z "$macro_version"; then
1010 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
1011 $progname: definition of this LT_INIT comes from an older release.
1012 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1013 $progname: and run autoconf again.
1017 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
1018 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
1019 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1020 $progname: and run autoconf again.
1025 $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
1026 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
1027 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
1028 $progname: of $PACKAGE $VERSION and run autoconf again.
1038 # True iff FILE is a libtool `.la' library or `.lo' object file.
1039 # This function is only a basic sanity check; it will hardly flush out
1040 # determined imposters.
1043 $SED -e 4q
"$1" 2>/dev
/null \
1044 | $GREP "^# Generated by .*$PACKAGE" > /dev
/null
2>&1
1047 # func_lalib_unsafe_p file
1048 # True iff FILE is a libtool `.la' library or `.lo' object file.
1049 # This function implements the same check as func_lalib_p without
1050 # resorting to external programs. To this end, it redirects stdin and
1051 # closes it afterwards, without saving the original file descriptor.
1052 # As a safety measure, use it only where a negative result would be
1053 # fatal anyway. Works if `file' does not exist.
1054 func_lalib_unsafe_p
()
1057 if test -r "$1" && exec 5<&1 <"$1"; then
1058 for lalib_p_l
in 1 2 3 4
1061 case "$lalib_p_line" in
1062 \
#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
1067 test "$lalib_p" = yes
1070 # func_ltwrapper_p file
1071 # True iff FILE is a libtool wrapper script.
1072 # This function is only a basic sanity check; it will hardly flush out
1073 # determined imposters.
1080 # func_execute_cmds commands fail_cmd
1081 # Execute tilde-delimited COMMANDS.
1082 # If FAIL_CMD is given, eval that upon failure.
1083 # FAIL_CMD may read-access the current command in variable CMD!
1084 func_execute_cmds
()
1087 save_ifs
=$IFS; IFS
='~'
1091 func_show_eval
"$cmd" "${2-:}"
1098 # Source FILE, adding directory component if necessary.
1099 # Note that it is not necessary on cygwin/mingw to append a dot to
1100 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
1101 # behavior happens only for exec(3), not for open(2)! Also, sourcing
1102 # `FILE.' does not work on cygwin managed mounts.
1107 */* | *\\*) .
"$1" ;;
1113 # Generated shell functions inserted here.
1116 # func_win32_libid arg
1117 # return the library type of file 'arg'
1119 # Need a lot of goo to handle *both* DLLs and import libs
1120 # Has to be a shell function in order to 'eat' the argument
1121 # that is supplied when $file_magic_command is called.
1125 win32_libid_type
="unknown"
1126 win32_fileres
=`file -L $1 2>/dev/null`
1127 case $win32_fileres in
1128 *ar\ archive\ import\ library
*) # definitely import
1129 win32_libid_type
="x86 archive import"
1131 *ar\ archive
*) # could be an import, or static
1132 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev
/null
|
1133 $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev
/null
; then
1134 win32_nmres
=`eval $NM -f posix -A $1 |
1143 case $win32_nmres in
1144 import
*) win32_libid_type
="x86 archive import";;
1145 *) win32_libid_type
="x86 archive static";;
1150 win32_libid_type
="x86 DLL"
1152 *executable
*) # but shell scripts are "executable" too...
1153 case $win32_fileres in
1154 *MS\ Windows\ PE\ Intel
*)
1155 win32_libid_type
="x86 DLL"
1160 $ECHO "$win32_libid_type"
1165 # func_infer_tag arg
1166 # Infer tagged configuration to use if any are available and
1167 # if one wasn't chosen via the "--tag" command line option.
1168 # Only attempt this if the compiler in the base compile
1169 # command doesn't match the default compiler.
1170 # arg is usually of the form 'gcc ...'
1174 if test -n "$available_tags" && test -z "$tagname"; then
1177 func_quote_for_eval
"$arg"
1178 CC_quoted
="$CC_quoted $func_quote_for_eval_result"
1181 # Blanks in the command may have been stripped by the calling shell,
1182 # but not from the CC environment variable when configure was run.
1183 " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
1184 # Blanks at the start of $base_compile will cause this to fail
1185 # if we don't check for them as well.
1187 for z
in $available_tags; do
1188 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev
/null
; then
1189 # Evaluate the configuration.
1190 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1193 # Double-quote args containing other shell metacharacters.
1194 func_quote_for_eval
"$arg"
1195 CC_quoted
="$CC_quoted $func_quote_for_eval_result"
1198 " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
1199 # The compiler in the base compile command matches
1200 # the one in the tagged configuration.
1201 # Assume this is the tagged configuration we want.
1208 # If $tagname still isn't set, then no tagged configuration
1209 # was found and let the user know that the "--tag" command
1210 # line option must be used.
1211 if test -z "$tagname"; then
1212 func_echo
"unable to infer tagged configuration"
1213 func_fatal_error
"specify a tag with \`--tag'"
1215 # func_verbose "using $tagname tagged configuration"
1224 # func_generate_dlsyms outputname originator pic_p
1225 # Extract symbols from dlprefiles and create ${outputname}S.o with
1226 # a dlpreopen symbol table.
1227 func_generate_dlsyms
()
1233 my_prefix
=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
1236 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no
; then
1237 if test -n "$NM" && test -n "$global_symbol_pipe"; then
1238 my_dlsyms
="${my_outputname}S.c"
1240 func_error
"not configured to extract global symbols from dlpreopened files"
1244 if test -n "$my_dlsyms"; then
1248 # Discover the nlist of each of the dlfiles.
1249 nlist
="$output_objdir/${my_outputname}.nm"
1251 func_show_eval
"$RM $nlist ${nlist}S ${nlist}T"
1253 # Parse the name list into a source file.
1254 func_echo
"creating $output_objdir/$my_dlsyms"
1256 $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
1257 /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
1258 /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
1264 /* External symbol declarations for the compiler. */\
1267 if test "$dlself" = yes; then
1268 func_echo
"generating symbol list for \`$output'"
1270 $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
1272 # Add our own program objects to the symbol list.
1273 progfiles
=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
1274 for progfile
in $progfiles; do
1275 func_echo
"extracting global C symbols from \`$progfile'"
1276 $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
1279 if test -n "$exclude_expsyms"; then
1281 eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
1282 eval '$MV "$nlist"T "$nlist"'
1286 if test -n "$export_symbols_regex"; then
1288 eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
1289 eval '$MV "$nlist"T "$nlist"'
1293 # Prepare the list of exported symbols
1294 if test -z "$export_symbols"; then
1295 export_symbols
="$output_objdir/$outputname.exp"
1298 eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
1300 *cygwin
* | *mingw
* )
1301 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
1302 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
1308 eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
1309 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
1310 eval '$MV "$nlist"T "$nlist"'
1313 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
1314 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
1321 for dlprefile
in $dlprefiles; do
1322 func_echo
"extracting global C symbols from \`$dlprefile'"
1323 func_basename
"$dlprefile"
1324 name
="$func_basename_result"
1326 eval '$ECHO ": $name " >> "$nlist"'
1327 eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
1332 # Make sure we have at least an empty file.
1333 test -f "$nlist" || : > "$nlist"
1335 if test -n "$exclude_expsyms"; then
1336 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
1337 $MV "$nlist"T
"$nlist"
1340 # Try sorting and uniquifying the output.
1341 if $GREP -v "^: " < "$nlist" |
1342 if sort -k 3 </dev
/null
>/dev
/null
2>&1; then
1347 uniq > "$nlist"S
; then
1350 $GREP -v "^: " < "$nlist" > "$nlist"S
1353 if test -f "$nlist"S
; then
1354 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
1356 $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
1359 $ECHO >> "$output_objdir/$my_dlsyms" "\
1361 /* The mapping between symbol names and symbols. */
1364 *cygwin
* | *mingw
* )
1365 $ECHO >> "$output_objdir/$my_dlsyms" "\
1366 /* DATA imports from DLLs on WIN32 con't be const, because
1367 runtime relocations are performed -- see ld's documentation
1368 on pseudo-relocs. */
1373 $ECHO >> "$output_objdir/$my_dlsyms" "\
1379 $ECHO >> "$output_objdir/$my_dlsyms" "\
1383 lt_${my_prefix}_LTX_preloaded_symbols[] =
1385 { \"$my_originator\", (void *) 0 },
1388 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
1390 $ECHO >> "$output_objdir/$my_dlsyms" "\
1394 /* This works around a problem in FreeBSD linker */
1395 #ifdef FREEBSD_WORKAROUND
1396 static const void *lt_preloaded_setup() {
1397 return lt_${my_prefix}_LTX_preloaded_symbols;
1407 pic_flag_for_symtable
=
1408 case "$compile_command " in
1412 # compiling the symbol table file with pic_flag works around
1413 # a FreeBSD bug that causes programs to crash when -lm is
1414 # linked before any other PIC object. But we must not use
1415 # pic_flag when linking with -static. The problem exists in
1416 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
1417 *-*-freebsd2*|*-*-freebsd3.0
*|*-*-freebsdelf3.0
*)
1418 pic_flag_for_symtable
=" $pic_flag -DFREEBSD_WORKAROUND" ;;
1420 pic_flag_for_symtable
=" $pic_flag" ;;
1422 if test "X$my_pic_p" != Xno
; then
1423 pic_flag_for_symtable
=" $pic_flag"
1430 for arg
in $LTCFLAGS; do
1432 -pie | -fpie | -fPIE) ;;
1433 *) symtab_cflags
="$symtab_cflags $arg" ;;
1437 # Now compile the dynamic symbol file.
1438 func_show_eval
'(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
1440 # Clean up the generated files.
1441 func_show_eval
'$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
1443 # Transform the symbol file into the correct name.
1444 symfileobj
="$output_objdir/${my_outputname}S.$objext"
1446 *cygwin
* | *mingw
* )
1447 if test -f "$output_objdir/$my_outputname.def"; then
1448 compile_command
=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
1449 finalize_command
=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
1451 compile_command
=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
1452 finalize_command
=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
1456 compile_command
=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
1457 finalize_command
=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
1462 func_fatal_error
"unknown suffix for \`$my_dlsyms'"
1466 # We keep going just in case the user didn't refer to
1467 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
1468 # really was required.
1470 # Nullify the symbol file.
1471 compile_command
=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
1472 finalize_command
=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
1476 # func_extract_an_archive dir oldlib
1477 func_extract_an_archive
()
1480 f_ex_an_ar_dir
="$1"; shift
1481 f_ex_an_ar_oldlib
="$1"
1482 func_show_eval
"(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" 'exit $?'
1483 if ($AR t
"$f_ex_an_ar_oldlib" | sort | sort -uc >/dev
/null
2>&1); then
1486 func_fatal_error
"object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
1491 # func_extract_archives gentop oldlib ...
1492 func_extract_archives
()
1495 my_gentop
="$1"; shift
1496 my_oldlibs
=${1+"$@"}
1502 for my_xlib
in $my_oldlibs; do
1503 # Extract the objects.
1505 [\\/]* | [A
-Za-z]:[\\/]*) my_xabs
="$my_xlib" ;;
1506 *) my_xabs
=`pwd`"/$my_xlib" ;;
1508 func_basename
"$my_xlib"
1509 my_xlib
="$func_basename_result"
1510 my_xdir
="$my_gentop/$my_xlib"
1512 func_mkdir_p
"$my_xdir"
1516 func_echo
"Extracting $my_xabs"
1517 # Do not bother doing anything if just a dry run
1519 darwin_orig_dir
=`pwd`
1520 cd $my_xdir || exit $?
1521 darwin_archive
=$my_xabs
1523 darwin_base_archive
=`basename $darwin_archive`
1524 darwin_arches
=`lipo -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
1525 if test -n "$darwin_arches"; then
1526 darwin_arches
=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
1528 func_echo
"$darwin_base_archive has multiple architectures $darwin_arches"
1529 for darwin_arch
in $darwin_arches ; do
1530 func_mkdir_p
"unfat-$$/${darwin_base_archive}-${darwin_arch}"
1531 lipo
-thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
1532 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
1533 func_extract_an_archive
"`pwd`" "${darwin_base_archive}"
1535 $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
1536 done # $darwin_arches
1537 ## Okay now we've a bunch of thin objects, gotta fatten them up :)
1538 darwin_filelist
=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
1541 for darwin_file
in $darwin_filelist; do
1542 darwin_files
=`find unfat-$$ -name $darwin_file -print | $NL2SP`
1543 lipo
-create -output "$darwin_file" $darwin_files
1544 done # $darwin_filelist
1546 cd "$darwin_orig_dir"
1549 func_extract_an_archive
"$my_xdir" "$my_xabs"
1554 func_extract_an_archive
"$my_xdir" "$my_xabs"
1557 my_oldobjs
="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
1560 func_extract_archives_result
="$my_oldobjs"
1564 # func_mode_compile arg...
1565 func_mode_compile
()
1568 # Get the compilation command and the source file.
1570 srcfile
="$nonopt" # always keep a non-empty value in "srcfile"
1582 # do not "continue". Instead, add this to base_compile
1594 # Accept any command-line options.
1597 test -n "$libobj" && \
1598 func_fatal_error
"you cannot specify \`-o' more than once"
1603 -pie | -fpie | -fPIE)
1604 pie_flag
="$pie_flag $arg"
1608 -shared | -static | -prefer-pic | -prefer-non-pic)
1619 arg_mode
=arg
# the next one goes into the "base_compile" arg list
1620 continue # The current "srcfile" will either be retained or
1621 ;; # replaced later. I would guess that would be a bug.
1624 func_stripname
'-Wc,' '' "$arg"
1625 args
=$func_stripname_result
1627 save_ifs
="$IFS"; IFS
=','
1628 for arg
in $args; do
1630 func_quote_for_eval
"$arg"
1631 lastarg
="$lastarg $func_quote_for_eval_result"
1634 func_stripname
' ' '' "$lastarg"
1635 lastarg
=$func_stripname_result
1637 # Add the arguments to base_compile.
1638 base_compile
="$base_compile $lastarg"
1643 # Accept the current argument as the source file.
1644 # The previous "srcfile" becomes the current argument.
1651 esac # case $arg_mode
1653 # Aesthetically quote the previous argument.
1654 func_quote_for_eval
"$lastarg"
1655 base_compile
="$base_compile $func_quote_for_eval_result"
1660 func_fatal_error
"you must specify an argument for -Xcompile"
1663 func_fatal_error
"you must specify a target with \`-o'"
1666 # Get the name of the library object.
1667 test -z "$libobj" && {
1668 func_basename
"$srcfile"
1669 libobj
="$func_basename_result"
1674 # Recognize several different file suffixes.
1675 # If the user specifies -o file.o, it is replaced with file.lo
1685 *.class
) xform
=class
;;
1690 *.java
) xform
=java
;;
1694 libobj
=`$ECHO "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
1697 *.lo
) obj
=`$ECHO "X$libobj" | $Xsed -e "$lo2o"` ;;
1699 func_fatal_error
"cannot determine name of library object from \`$libobj'"
1703 func_infer_tag
$base_compile
1705 for arg
in $later; do
1708 test "$build_libtool_libs" != yes && \
1709 func_fatal_configuration
"can not build a shared library"
1715 build_libtool_libs
=no
1732 func_quote_for_eval
"$libobj"
1733 test "X$libobj" != "X$func_quote_for_eval_result" \
1734 && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
1735 && func_warning
"libobj name \`$libobj' may not contain shell special characters."
1736 func_basename
"$obj"
1737 objname
="$func_basename_result"
1738 func_dirname
"$obj" "/" ""
1739 xdir
="$func_dirname_result"
1740 lobj
=${xdir}$objdir/$objname
1742 test -z "$base_compile" && \
1743 func_fatal_help
"you must specify a compilation command"
1745 # Delete any leftover library objects.
1746 if test "$build_old_libs" = yes; then
1747 removelist
="$obj $lobj $libobj ${libobj}T"
1749 removelist
="$lobj $libobj ${libobj}T"
1752 $opt_dry_run || $RM $removelist
1753 trap "$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE" 1 2 15
1755 # On Cygwin there's no "real" PIC flag so we must build both object types
1757 cygwin
* | mingw
* | pw32
* | os2
*)
1761 if test "$pic_mode" = no
&& test "$deplibs_check_method" != pass_all
; then
1762 # non-PIC code in shared libraries is not supported
1766 # Calculate the filename of the output object if compiler does
1767 # not support -o with -c
1768 if test "$compiler_c_o" = no
; then
1769 output_obj
=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.
${objext}
1770 lockfile
="$output_obj.lock"
1771 removelist
="$removelist $output_obj $lockfile"
1772 trap "$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE" 1 2 15
1779 # Lock this critical section if it is needed
1780 # We use this script file to make the link, it avoids creating a new file
1781 if test "$need_locks" = yes; then
1782 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev
/null
; do
1783 func_echo
"Waiting for $lockfile to be removed"
1786 elif test "$need_locks" = warn
; then
1787 if test -f "$lockfile"; then
1789 *** ERROR, $lockfile exists and contains:
1790 `cat $lockfile 2>/dev/null`
1792 This indicates that another process is trying to use the same
1793 temporary object file, and libtool could not work around it because
1794 your compiler does not support \`-c' and \`-o' together. If you
1795 repeat this compilation, it may succeed, by chance, but you had better
1796 avoid parallel builds (make -j) in this platform, or get a better
1799 $opt_dry_run || $RM $removelist
1802 $ECHO "$srcfile" > "$lockfile"
1805 if test -n "$fix_srcfile_path"; then
1806 eval srcfile
=\"$fix_srcfile_path\"
1808 func_quote_for_eval
"$srcfile"
1809 qsrcfile
=$func_quote_for_eval_result
1811 $opt_dry_run || $RM "$libobj" "${libobj}T"
1813 # Create a libtool object file (analogous to a ".la" file),
1814 # but don't create it if we're doing a dry run.
1815 $opt_dry_run || cat > ${libobj}T
<<EOF
1816 # $libobj - a libtool object file
1817 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
1819 # Please DO NOT delete this file!
1820 # It is necessary for linking the library.
1822 # Name of the PIC object.
1825 # Only build a PIC object if we are building libtool libraries.
1826 if test "$build_libtool_libs" = yes; then
1827 # Without this assignment, base_compile gets emptied.
1828 fbsd_hideous_sh_bug
=$base_compile
1830 if test "$pic_mode" != no
; then
1831 command="$base_compile $qsrcfile $pic_flag"
1833 # Don't build PIC code
1834 command="$base_compile $qsrcfile"
1837 func_mkdir_p
"$xdir$objdir"
1839 if test -z "$output_obj"; then
1840 # Place PIC objects in $objdir
1841 command="$command -o $lobj"
1844 $opt_dry_run || $RM "$lobj" "$output_obj"
1846 func_show_eval
"$command" \
1847 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
1849 if test "$need_locks" = warn
&&
1850 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1852 *** ERROR, $lockfile contains:
1853 `cat $lockfile 2>/dev/null`
1855 but it should contain:
1858 This indicates that another process is trying to use the same
1859 temporary object file, and libtool could not work around it because
1860 your compiler does not support \`-c' and \`-o' together. If you
1861 repeat this compilation, it may succeed, by chance, but you had better
1862 avoid parallel builds (make -j) in this platform, or get a better
1865 $opt_dry_run || $RM $removelist
1869 # Just move the object if needed, then go on to compile the next one
1870 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1871 func_show_eval
'$MV "$output_obj" "$lobj"' \
1872 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
1875 # Append the name of the PIC object to the libtool object file.
1876 $opt_dry_run || cat >> ${libobj}T
<<EOF
1877 pic_object='$objdir/$objname'
1881 # Allow error messages only from the first compilation.
1882 if test "$suppress_opt" = yes; then
1883 suppress_output
=' >/dev/null 2>&1'
1886 # No PIC object so indicate it doesn't exist in the libtool
1888 $opt_dry_run || cat >> ${libobj}T
<<EOF
1894 # Only build a position-dependent object if we build old libraries.
1895 if test "$build_old_libs" = yes; then
1896 if test "$pic_mode" != yes; then
1897 # Don't build PIC code
1898 command="$base_compile $qsrcfile$pie_flag"
1900 command="$base_compile $qsrcfile $pic_flag"
1902 if test "$compiler_c_o" = yes; then
1903 command="$command -o $obj"
1906 # Suppress compiler output if we already did a PIC compilation.
1907 command="$command$suppress_output"
1908 $opt_dry_run || $RM "$obj" "$output_obj"
1909 func_show_eval
"$command" \
1910 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
1912 if test "$need_locks" = warn
&&
1913 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1915 *** ERROR, $lockfile contains:
1916 `cat $lockfile 2>/dev/null`
1918 but it should contain:
1921 This indicates that another process is trying to use the same
1922 temporary object file, and libtool could not work around it because
1923 your compiler does not support \`-c' and \`-o' together. If you
1924 repeat this compilation, it may succeed, by chance, but you had better
1925 avoid parallel builds (make -j) in this platform, or get a better
1928 $opt_dry_run || $RM $removelist
1932 # Just move the object if needed
1933 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1934 func_show_eval
'$MV "$output_obj" "$obj"' \
1935 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
1938 # Append the name of the non-PIC object the libtool object file.
1939 # Only append if the libtool object file exists.
1940 $opt_dry_run || cat >> ${libobj}T
<<EOF
1941 # Name of the non-PIC object.
1942 non_pic_object='$objname'
1946 # Append the name of the non-PIC object the libtool object file.
1947 # Only append if the libtool object file exists.
1948 $opt_dry_run || cat >> ${libobj}T
<<EOF
1949 # Name of the non-PIC object.
1956 $MV "${libobj}T" "${libobj}"
1958 # Unlock the critical section if it was locked
1959 if test "$need_locks" != no
; then
1968 # func_mode_execute arg...
1969 func_mode_execute
()
1972 # The first argument is the command name.
1975 func_fatal_help
"you must specify a COMMAND"
1977 # Handle -dlopen flags immediately.
1978 for file in $execute_dlfiles; do
1980 || func_fatal_help
"\`$file' is not a file"
1985 # Check to see that this really is a libtool archive.
1986 func_lalib_unsafe_p
"$file" \
1987 || func_fatal_help
"\`$lib' is not a valid libtool archive"
1989 # Read the libtool library.
1994 # Skip this library if it cannot be dlopened.
1995 if test -z "$dlname"; then
1996 # Warn if it was a shared library.
1997 test -n "$library_names" && \
1998 func_warning
"\`$file' was not linked with \`-export-dynamic'"
2002 func_dirname
"$file" "" "."
2003 dir
="$func_dirname_result"
2005 if test -f "$dir/$objdir/$dlname"; then
2008 func_fatal_error
"cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
2013 # Just add the directory containing the .lo file.
2014 func_dirname
"$file" "" "."
2015 dir
="$func_dirname_result"
2019 func_warning
"\`-dlopen' is ignored for non-libtool libraries and objects"
2024 # Get the absolute pathname.
2025 absdir
=`cd "$dir" && pwd`
2026 test -n "$absdir" && dir
="$absdir"
2028 # Now add the directory to shlibpath_var.
2029 if eval "test -z \"\$$shlibpath_var\""; then
2030 eval "$shlibpath_var=\"\$dir\""
2032 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
2036 # This variable tells wrapper scripts just to set shlibpath_var
2037 # rather than running their programs.
2038 libtool_execute_magic
="$magic"
2040 # Check if any of the arguments is a wrapper script.
2047 # Do a test to see if this is really a libtool program.
2048 if func_ltwrapper_p
"$file"; then
2051 # Transform arg to wrapped name.
2052 file="$progdir/$program"
2056 # Quote arguments (to preserve shell metacharacters).
2057 func_quote_for_eval
"$file"
2058 args
="$args $func_quote_for_eval_result"
2061 if test "X$opt_dry_run" = Xfalse
; then
2062 if test -n "$shlibpath_var"; then
2063 # Export the shlibpath_var.
2064 eval "export $shlibpath_var"
2067 # Restore saved environment variables
2068 if test "${save_LC_ALL+set}" = set; then
2069 LC_ALL
="$save_LC_ALL"; export LC_ALL
2071 if test "${save_LANG+set}" = set; then
2072 LANG
="$save_LANG"; export LANG
2075 # Now prepare to actually exec the command.
2076 exec_cmd
="\$cmd$args"
2078 # Display what would be done.
2079 if test -n "$shlibpath_var"; then
2080 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
2081 $ECHO "export $shlibpath_var"
2089 # func_mode_finish arg...
2096 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
2099 libdirs
="$libdirs $dir"
2102 for libdir
in $libdirs; do
2103 if test -n "$finish_cmds"; then
2104 # Do each command in the finish commands.
2105 func_execute_cmds
"$finish_cmds" 'admincmds="$admincmds
2108 if test -n "$finish_eval"; then
2109 # Do the single finish_eval.
2110 eval cmds
=\"$finish_eval\"
2111 $opt_dry_run || eval "$cmds" || admincmds
="$admincmds
2117 # Exit here if they wanted silent mode.
2118 $opt_silent && exit $EXIT_SUCCESS
2120 $ECHO "X----------------------------------------------------------------------" | $Xsed
2121 $ECHO "Libraries have been installed in:"
2122 for libdir
in $libdirs; do
2126 $ECHO "If you ever happen to want to link against installed libraries"
2127 $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
2128 $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
2129 $ECHO "flag during linking and do at least one of the following:"
2130 if test -n "$shlibpath_var"; then
2131 $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable"
2132 $ECHO " during execution"
2134 if test -n "$runpath_var"; then
2135 $ECHO " - add LIBDIR to the \`$runpath_var' environment variable"
2136 $ECHO " during linking"
2138 if test -n "$hardcode_libdir_flag_spec"; then
2140 eval flag
=\"$hardcode_libdir_flag_spec\"
2142 $ECHO " - use the \`$flag' linker flag"
2144 if test -n "$admincmds"; then
2145 $ECHO " - have your system administrator run these commands:$admincmds"
2147 if test -f /etc
/ld.so.conf
; then
2148 $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
2152 $ECHO "See any operating system documentation about shared libraries for"
2154 solaris2.
[6789]|solaris2.1
[0-9])
2155 $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
2159 $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
2162 $ECHO "X----------------------------------------------------------------------" | $Xsed
2167 # func_mode_install arg...
2168 func_mode_install
()
2171 # There may be an optional sh(1) argument at the beginning of
2172 # install_prog (especially on Windows NT).
2173 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin
/sh
||
2174 # Allow the use of GNU shtool's install command.
2175 $ECHO "X$nonopt" | $GREP shtool
>/dev
/null
; then
2176 # Aesthetically quote it.
2177 func_quote_for_eval
"$nonopt"
2178 install_prog
="$func_quote_for_eval_result "
2186 # The real first argument should be the name of the installation program.
2187 # Aesthetically quote it.
2188 func_quote_for_eval
"$arg"
2189 install_prog
="$install_prog$func_quote_for_eval_result"
2191 # We need to accept at least all the BSD install flags.
2201 if test -n "$dest"; then
2202 files
="$files $dest"
2210 case " $install_prog " in
2225 # If the previous option needed an argument, then skip it.
2226 if test -n "$prev"; then
2235 # Aesthetically quote the argument.
2236 func_quote_for_eval
"$arg"
2237 install_prog
="$install_prog $func_quote_for_eval_result"
2240 test -z "$install_prog" && \
2241 func_fatal_help
"you must specify an install program"
2243 test -n "$prev" && \
2244 func_fatal_help
"the \`$prev' option requires an argument"
2246 if test -z "$files"; then
2247 if test -z "$dest"; then
2248 func_fatal_help
"no file or destination specified"
2250 func_fatal_help
"you must specify a destination"
2254 # Strip any trailing slash from the destination.
2255 func_stripname
'' '/' "$dest"
2256 dest
=$func_stripname_result
2258 # Check to see that the destination is a directory.
2259 test -d "$dest" && isdir
=yes
2260 if test "$isdir" = yes; then
2264 func_dirname
"$dest" "" "."
2265 destdir
="$func_dirname_result"
2266 func_basename
"$dest"
2267 destname
="$func_basename_result"
2269 # Not a directory, so check to see that there is only one file specified.
2270 set dummy
$files; shift
2271 test "$#" -gt 1 && \
2272 func_fatal_help
"\`$dest' is not a directory"
2275 [\\/]* | [A
-Za-z]:[\\/]*) ;;
2277 for file in $files; do
2281 func_fatal_help
"\`$destdir' must be an absolute directory name"
2288 # This variable tells wrapper scripts just to set variables rather
2289 # than running their programs.
2290 libtool_install_magic
="$magic"
2295 for file in $files; do
2297 # Do each installation.
2300 # Do the static libraries later.
2301 staticlibs
="$staticlibs $file"
2305 # Check to see that this really is a libtool archive.
2306 func_lalib_unsafe_p
"$file" \
2307 || func_fatal_help
"\`$file' is not a valid libtool archive"
2314 # Add the libdir to current_libdirs if it is the destination.
2315 if test "X$destdir" = "X$libdir"; then
2316 case "$current_libdirs " in
2318 *) current_libdirs
="$current_libdirs $libdir" ;;
2321 # Note the libdir as a future libdir.
2322 case "$future_libdirs " in
2324 *) future_libdirs
="$future_libdirs $libdir" ;;
2328 func_dirname
"$file" "/" ""
2329 dir
="$func_dirname_result"
2332 if test -n "$relink_command"; then
2333 # Determine the prefix the user has applied to our future dir.
2334 inst_prefix_dir
=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
2336 # Don't allow the user to place us outside of our expected
2337 # location b/c this prevents finding dependent libraries that
2338 # are installed to the same prefix.
2339 # At present, this check doesn't affect windows .dll's that
2340 # are installed into $libdir/../bin (currently, that works fine)
2341 # but it's something to keep an eye on.
2342 test "$inst_prefix_dir" = "$destdir" && \
2343 func_fatal_error
"error: cannot install \`$file' to a directory not ending in $libdir"
2345 if test -n "$inst_prefix_dir"; then
2346 # Stick the inst_prefix_dir data into the link command.
2347 relink_command
=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
2349 relink_command
=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
2352 func_warning
"relinking \`$file'"
2353 func_show_eval
"$relink_command" \
2354 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
2357 # See the names of the shared library.
2358 set dummy
$library_names; shift
2359 if test -n "$1"; then
2364 test -n "$relink_command" && srcname
="$realname"T
2366 # Install the shared library and build the symlinks.
2367 func_show_eval
"$install_prog $dir/$srcname $destdir/$realname" \
2371 cygwin
* | mingw
* | pw32
*)
2379 if test -n "$tstripme" && test -n "$striplib"; then
2380 func_show_eval
"$striplib $destdir/$realname" 'exit $?'
2383 if test "$#" -gt 0; then
2384 # Delete the old symlinks, and create new ones.
2385 # Try `ln -sf' first, because the `ln' binary might depend on
2386 # the symlink we replace! Solaris /bin/ln does not understand -f,
2387 # so we also need to try rm && ln -s.
2390 test "$linkname" != "$realname" \
2391 && func_show_eval
"(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
2395 # Do each command in the postinstall commands.
2396 lib
="$destdir/$realname"
2397 func_execute_cmds
"$postinstall_cmds" 'exit $?'
2400 # Install the pseudo-library for information purposes.
2401 func_basename
"$file"
2402 name
="$func_basename_result"
2403 instname
="$dir/$name"i
2404 func_show_eval
"$install_prog $instname $destdir/$name" 'exit $?'
2406 # Maybe install the static library, too.
2407 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
2411 # Install (i.e. copy) a libtool object.
2413 # Figure out destination file name, if it wasn't already specified.
2414 if test -n "$destname"; then
2415 destfile
="$destdir/$destname"
2417 func_basename
"$file"
2418 destfile
="$func_basename_result"
2419 destfile
="$destdir/$destfile"
2422 # Deduce the name of the destination old-style object file.
2425 staticdest
=`$ECHO "X$destfile" | $Xsed -e "$lo2o"`
2428 staticdest
="$destfile"
2432 func_fatal_help
"cannot copy a libtool object to \`$destfile'"
2436 # Install the libtool object if requested.
2437 test -n "$destfile" && \
2438 func_show_eval
"$install_prog $file $destfile" 'exit $?'
2440 # Install the old object if enabled.
2441 if test "$build_old_libs" = yes; then
2442 # Deduce the name of the old-style object file.
2443 staticobj
=`$ECHO "X$file" | $Xsed -e "$lo2o"`
2444 func_show_eval
"$install_prog \$staticobj \$staticdest" 'exit $?'
2450 # Figure out destination file name, if it wasn't already specified.
2451 if test -n "$destname"; then
2452 destfile
="$destdir/$destname"
2454 func_basename
"$file"
2455 destfile
="$func_basename_result"
2456 destfile
="$destdir/$destfile"
2459 # If the file is missing, and there is a .exe on the end, strip it
2460 # because it is most likely a libtool script we actually want to
2465 if test ! -f "$file"; then
2466 func_stripname
'' '.exe' "$file"
2467 file=$func_stripname_result
2473 # Do a test to see if this is really a libtool program.
2476 func_stripname
'' '.exe' "$file"
2477 wrapper
=$func_stripname_result
2483 if func_ltwrapper_p
"$wrapper"; then
2487 func_source
"$wrapper"
2489 # Check the variables that should have been set.
2490 test -z "$generated_by_libtool_version" && \
2491 func_fatal_error
"invalid libtool wrapper script \`$wrapper'"
2494 for lib
in $notinst_deplibs; do
2495 # Check to see that each library is installed.
2497 if test -f "$lib"; then
2500 libfile
="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
2501 if test -n "$libdir" && test ! -f "$libfile"; then
2502 func_warning
"\`$lib' has not been installed in \`$libdir'"
2508 func_source
"$wrapper"
2511 if test "$fast_install" = no
&& test -n "$relink_command"; then
2513 if test "$finalize" = yes; then
2514 tmpdir
=`func_mktempdir`
2515 func_basename
"$file$stripped_ext"
2516 file="$func_basename_result"
2517 outputname
="$tmpdir/$file"
2518 # Replace the output file specification.
2519 relink_command
=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
2522 func_quote_for_expand
"$relink_command"
2523 eval "func_echo $func_quote_for_expand_result"
2525 if eval "$relink_command"; then :
2527 func_error
"error: relink \`$file' with the above command before installing it"
2528 $opt_dry_run || ${RM}r
"$tmpdir"
2533 func_warning
"cannot relink \`$file'"
2537 # Install the binary that we compiled earlier.
2538 file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
2542 # remove .exe since cygwin /usr/bin/install will append another
2544 case $install_prog,$host in
2545 */usr
/bin
/install*,*cygwin
*)
2546 case $file:$destfile in
2551 destfile
=$destfile.exe
2554 func_stripname
'' '.exe' "$destfile"
2555 destfile
=$func_stripname_result
2560 func_show_eval
"$install_prog\$stripme \$file \$destfile" 'exit $?'
2561 $opt_dry_run || if test -n "$outputname"; then
2568 for file in $staticlibs; do
2569 func_basename
"$file"
2570 name
="$func_basename_result"
2572 # Set up the ranlib parameters.
2573 oldlib
="$destdir/$name"
2575 func_show_eval
"$install_prog \$file \$oldlib" 'exit $?'
2577 if test -n "$stripme" && test -n "$old_striplib"; then
2578 func_show_eval
"$old_striplib $oldlib" 'exit $?'
2581 # Do each command in the postinstall commands.
2582 func_execute_cmds
"$old_postinstall_cmds" 'exit $?'
2585 test -n "$future_libdirs" && \
2586 func_warning
"remember to run \`$progname --finish$future_libdirs'"
2588 if test -n "$current_libdirs"; then
2589 # Maybe just do a dry run.
2590 $opt_dry_run && current_libdirs
=" -n$current_libdirs"
2591 exec_cmd
='$SHELL $progpath $preserve_args --finish$current_libdirs'
2598 # func_mode_link arg...
2603 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
2604 # It is impossible to link a dll without this setting, and
2605 # we shouldn't force the makefile maintainer to figure out
2606 # which system we are compiling for in order to pass an extra
2607 # flag for every libtool invocation.
2608 # allow_undefined=no
2610 # FIXME: Unfortunately, there are problems with the above when trying
2611 # to make a dll which has undefined symbols, in which case not
2612 # even a static library is built. For now, we need to specify
2613 # -no-undefined on the libtool link line when we can be certain
2614 # that all symbols are satisfied, otherwise we get a static library.
2621 libtool_args
="$nonopt"
2622 base_compile
="$nonopt $@"
2623 compile_command
="$nonopt"
2624 finalize_command
="$nonopt"
2637 lib_search_path
=`pwd`
2639 new_inherited_linker_flags
=
2647 export_symbols_regex
=
2655 precious_files_regex
=
2656 prefer_static_libs
=no
2669 single_module
="${wl}-single_module"
2670 func_infer_tag
$base_compile
2672 # We need to know -static, to get the right output filenames.
2677 test "$build_libtool_libs" != yes && \
2678 func_fatal_configuration
"can not build a shared library"
2682 -all-static | -static)
2683 if test "X$arg" = "X-all-static"; then
2684 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
2685 func_warning
"complete static linking is impossible in this configuration"
2687 if test -n "$link_static_flag"; then
2688 dlopen_self
=$dlopen_self_static
2689 # See comment for -static flag below, for more details.
2690 compile_command
="$compile_command $link_static_flag"
2691 finalize_command
="$finalize_command $link_static_flag"
2693 prefer_static_libs
=yes
2695 if test -z "$pic_flag" && test -n "$link_static_flag"; then
2696 dlopen_self
=$dlopen_self_static
2698 prefer_static_libs
=built
2700 build_libtool_libs
=no
2707 # See if our shared archives depend on static archives.
2708 test -n "$old_archive_from_new_cmds" && build_old_libs
=yes
2710 # Go through the arguments, transforming them on the way.
2711 while test "$#" -gt 0; do
2714 func_quote_for_eval
"$arg"
2715 qarg
="$func_quote_for_eval_unquoted_result"
2716 libtool_args
="$libtool_args $func_quote_for_eval_result"
2718 # If the previous option needs an argument, assign it.
2719 if test -n "$prev"; then
2722 compile_command
="$compile_command @OUTPUT@"
2723 finalize_command
="$finalize_command @OUTPUT@"
2729 if test "$preload" = no
; then
2730 # Add the symbol object into the linking commands.
2731 compile_command
="$compile_command @SYMFILE@"
2732 finalize_command
="$finalize_command @SYMFILE@"
2736 *.la
| *.lo
) ;; # We handle these cases below.
2738 if test "$dlself" = no
; then
2746 if test "$prev" = dlprefiles
; then
2748 elif test "$prev" = dlfiles
&& test "$dlopen_self" != yes; then
2758 if test "$prev" = dlfiles
; then
2759 dlfiles
="$dlfiles $arg"
2761 dlprefiles
="$dlprefiles $arg"
2769 export_symbols
="$arg"
2771 || func_fatal_error
"symbol file \`$arg' does not exist"
2776 export_symbols_regex
="$arg"
2784 *" $qarg.ltframework "*) ;;
2785 *) deplibs
="$deplibs $qarg.ltframework" # this is fixed later
2794 inst_prefix_dir
="$arg"
2799 if test -f "$arg"; then
2802 for fil
in `cat "$save_arg"`
2804 # moreargs="$moreargs $fil"
2806 # A libtool-controlled object.
2808 # Check to see that this really is a libtool object.
2809 if func_lalib_unsafe_p
"$arg"; then
2816 if test -z "$pic_object" ||
2817 test -z "$non_pic_object" ||
2818 test "$pic_object" = none
&&
2819 test "$non_pic_object" = none
; then
2820 func_fatal_error
"cannot find name of object for \`$arg'"
2823 # Extract subdirectory from the argument.
2824 func_dirname
"$arg" "/" ""
2825 xdir
="$func_dirname_result"
2827 if test "$pic_object" != none
; then
2828 # Prepend the subdirectory the object is found in.
2829 pic_object
="$xdir$pic_object"
2831 if test "$prev" = dlfiles
; then
2832 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
2833 dlfiles
="$dlfiles $pic_object"
2837 # If libtool objects are unsupported, then we need to preload.
2842 # CHECK ME: I think I busted this. -Ossama
2843 if test "$prev" = dlprefiles
; then
2844 # Preload the old-style object.
2845 dlprefiles
="$dlprefiles $pic_object"
2850 libobjs
="$libobjs $pic_object"
2855 if test "$non_pic_object" != none
; then
2856 # Prepend the subdirectory the object is found in.
2857 non_pic_object
="$xdir$non_pic_object"
2859 # A standard non-PIC object
2860 non_pic_objects
="$non_pic_objects $non_pic_object"
2861 if test -z "$pic_object" || test "$pic_object" = none
; then
2862 arg
="$non_pic_object"
2865 # If the PIC object exists, use it instead.
2866 # $xdir was prepended to $pic_object above.
2867 non_pic_object
="$pic_object"
2868 non_pic_objects
="$non_pic_objects $non_pic_object"
2871 # Only an error if not doing a dry-run.
2872 if $opt_dry_run; then
2873 # Extract subdirectory from the argument.
2874 func_dirname
"$arg" "/" ""
2875 xdir
="$func_dirname_result"
2877 pic_object
=`$ECHO "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
2878 non_pic_object
=`$ECHO "X${xdir}${arg}" | $Xsed -e "$lo2o"`
2879 libobjs
="$libobjs $pic_object"
2880 non_pic_objects
="$non_pic_objects $non_pic_object"
2882 func_fatal_error
"\`$arg' is not a valid libtool object"
2887 func_fatal_error
"link input file \`$arg' does not exist"
2894 precious_files_regex
="$arg"
2904 # We need an absolute path.
2906 [\\/]* | [A
-Za-z]:[\\/]*) ;;
2908 func_fatal_error
"only absolute run-paths are allowed"
2911 if test "$prev" = rpath
; then
2914 *) rpath
="$rpath $arg" ;;
2919 *) xrpath
="$xrpath $arg" ;;
2931 weak_libs
="$weak_libs $arg"
2936 linker_flags
="$linker_flags $qarg"
2937 compiler_flags
="$compiler_flags $qarg"
2939 compile_command
="$compile_command $qarg"
2940 finalize_command
="$finalize_command $qarg"
2944 compiler_flags
="$compiler_flags $qarg"
2946 compile_command
="$compile_command $qarg"
2947 finalize_command
="$finalize_command $qarg"
2951 linker_flags
="$linker_flags $qarg"
2952 compiler_flags
="$compiler_flags $wl$qarg"
2954 compile_command
="$compile_command $wl$qarg"
2955 finalize_command
="$finalize_command $wl$qarg"
2959 eval "$prev=\"\$arg\""
2964 fi # test -n "$prev"
2970 # The effects of -all-static are defined in a previous loop.
2975 # FIXME: remove this flag sometime in the future.
2976 func_fatal_error
"\`-allow-undefined' must not be used because it is the default"
2999 -export-symbols | -export-symbols-regex)
3000 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3001 func_fatal_error
"more than one -exported-symbols argument is not allowed"
3003 if test "X$arg" = "X-export-symbols"; then
3021 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
3022 # so, if we see these flags be careful not to treat them like -L
3024 case $with_gcc/$host in
3025 no
/*-*-irix* | /*-*-irix*)
3026 compile_command
="$compile_command $arg"
3027 finalize_command
="$finalize_command $arg"
3034 func_stripname
'-L' '' "$arg"
3035 dir
=$func_stripname_result
3036 # We need an absolute path.
3038 [\\/]* | [A
-Za-z]:[\\/]*) ;;
3040 absdir
=`cd "$dir" && pwd`
3041 test -z "$absdir" && \
3042 func_fatal_error
"cannot determine absolute directory name of \`$dir'"
3049 deplibs
="$deplibs -L$dir"
3050 lib_search_path
="$lib_search_path $dir"
3054 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
3055 testbindir
=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
3056 case :$dllsearchpath: in
3058 *) dllsearchpath
="$dllsearchpath:$dir";;
3060 case :$dllsearchpath: in
3061 *":$testbindir:"*) ;;
3062 *) dllsearchpath
="$dllsearchpath:$testbindir";;
3070 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
3072 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
3073 # These systems don't actually have a C or math library (as such)
3077 # These systems don't actually have a C library (as such)
3078 test "X$arg" = "X-lc" && continue
3080 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3081 # Do not include libc due to us having libc/libc_r.
3082 test "X$arg" = "X-lc" && continue
3084 *-*-rhapsody* | *-*-darwin1.
[012])
3085 # Rhapsody C and math libraries are in the System framework
3086 deplibs
="$deplibs System.ltframework"
3089 *-*-sco3.2v5
* | *-*-sco5v6*)
3090 # Causes problems with __ctype
3091 test "X$arg" = "X-lc" && continue
3093 *-*-sysv4.2uw2
* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
3094 # Compiler inserts libc in the correct place for threads to work
3095 test "X$arg" = "X-lc" && continue
3098 elif test "X$arg" = "X-lc_r"; then
3100 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3101 # Do not include libc_r directly, use -pthread flag.
3106 deplibs
="$deplibs $arg"
3115 # Tru64 UNIX uses -model [arg] to determine the layout of C++
3116 # classes, name mangling, and exception handling.
3117 # Darwin uses the -arch flag to determine output architecture.
3118 -model|-arch|-isysroot)
3119 compile_command
="$compile_command $arg"
3120 compiler_flags
="$compiler_flags $arg"
3121 finalize_command
="$finalize_command $arg"
3126 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
3127 compiler_flags
="$compiler_flags $arg"
3128 compile_command
="$compile_command $arg"
3129 finalize_command
="$finalize_command $arg"
3130 case "$new_inherited_linker_flags " in
3132 * ) new_inherited_linker_flags
="$new_inherited_linker_flags $arg" ;;
3138 single_module
="${wl}-multi_module"
3149 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
3150 # The PATH hackery in wrapper scripts is required on Windows
3151 # in order for the loader to find any dlls it needs.
3152 func_warning
"\`-no-install' is ignored for $host"
3153 func_warning
"assuming \`-no-fast-install' instead"
3156 *) no_install
=yes ;;
3173 -precious-files-regex)
3194 func_stripname
'-R' '' "$arg"
3195 dir
=$func_stripname_result
3196 # We need an absolute path.
3198 [\\/]* | [A
-Za-z]:[\\/]*) ;;
3200 func_fatal_error
"only absolute run-paths are allowed"
3205 *) xrpath
="$xrpath $dir" ;;
3211 # The effects of -shared are defined in a previous loop.
3221 # The effects of -static are defined in a previous loop.
3222 # We used to do the same as -all-static on platforms that
3223 # didn't have a PIC flag, but the assumption that the effects
3224 # would be equivalent was wrong. It would break on at least
3225 # Digital Unix and AIX.
3251 func_stripname
'-Wc,' '' "$arg"
3252 args
=$func_stripname_result
3254 save_ifs
="$IFS"; IFS
=','
3255 for flag
in $args; do
3257 func_quote_for_eval
"$flag"
3258 arg
="$arg $wl$func_quote_for_eval_result"
3259 compiler_flags
="$compiler_flags $func_quote_for_eval_result"
3262 func_stripname
' ' '' "$arg"
3263 arg
=$func_stripname_result
3267 func_stripname
'-Wl,' '' "$arg"
3268 args
=$func_stripname_result
3270 save_ifs
="$IFS"; IFS
=','
3271 for flag
in $args; do
3273 func_quote_for_eval
"$flag"
3274 arg
="$arg $wl$func_quote_for_eval_result"
3275 compiler_flags
="$compiler_flags $wl$func_quote_for_eval_result"
3276 linker_flags
="$linker_flags $func_quote_for_eval_result"
3279 func_stripname
' ' '' "$arg"
3280 arg
=$func_stripname_result
3298 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
3299 # -r[0-9][0-9]* specifies the processor on the SGI compiler
3300 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
3301 # +DA*, +DD* enable 64-bit mode on the HP compiler
3302 # -q* pass through compiler args for the IBM compiler
3303 # -m*, -t[45]*, -txscale* pass through architecture-specific
3304 # compiler args for GCC
3305 # @file GCC response files
3306 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA
*|+DD
*|-q*|-m*| \
3307 -t[45]*|-txscale*|@
*)
3308 func_quote_for_eval
"$arg"
3309 arg
="$func_quote_for_eval_result"
3310 compile_command
="$compile_command $arg"
3311 finalize_command
="$finalize_command $arg"
3312 compiler_flags
="$compiler_flags $arg"
3316 # Some other compiler flag.
3318 func_quote_for_eval
"$arg"
3319 arg
="$func_quote_for_eval_result"
3323 # A standard object.
3328 # A libtool-controlled object.
3330 # Check to see that this really is a libtool object.
3331 if func_lalib_unsafe_p
"$arg"; then
3338 if test -z "$pic_object" ||
3339 test -z "$non_pic_object" ||
3340 test "$pic_object" = none
&&
3341 test "$non_pic_object" = none
; then
3342 func_fatal_error
"cannot find name of object for \`$arg'"
3345 # Extract subdirectory from the argument.
3346 func_dirname
"$arg" "/" ""
3347 xdir
="$func_dirname_result"
3349 if test "$pic_object" != none
; then
3350 # Prepend the subdirectory the object is found in.
3351 pic_object
="$xdir$pic_object"
3353 if test "$prev" = dlfiles
; then
3354 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
3355 dlfiles
="$dlfiles $pic_object"
3359 # If libtool objects are unsupported, then we need to preload.
3364 # CHECK ME: I think I busted this. -Ossama
3365 if test "$prev" = dlprefiles
; then
3366 # Preload the old-style object.
3367 dlprefiles
="$dlprefiles $pic_object"
3372 libobjs
="$libobjs $pic_object"
3377 if test "$non_pic_object" != none
; then
3378 # Prepend the subdirectory the object is found in.
3379 non_pic_object
="$xdir$non_pic_object"
3381 # A standard non-PIC object
3382 non_pic_objects
="$non_pic_objects $non_pic_object"
3383 if test -z "$pic_object" || test "$pic_object" = none
; then
3384 arg
="$non_pic_object"
3387 # If the PIC object exists, use it instead.
3388 # $xdir was prepended to $pic_object above.
3389 non_pic_object
="$pic_object"
3390 non_pic_objects
="$non_pic_objects $non_pic_object"
3393 # Only an error if not doing a dry-run.
3394 if $opt_dry_run; then
3395 # Extract subdirectory from the argument.
3396 func_dirname
"$arg" "/" ""
3397 xdir
="$func_dirname_result"
3399 pic_object
=`$ECHO "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
3400 non_pic_object
=`$ECHO "X${xdir}${arg}" | $Xsed -e "$lo2o"`
3401 libobjs
="$libobjs $pic_object"
3402 non_pic_objects
="$non_pic_objects $non_pic_object"
3404 func_fatal_error
"\`$arg' is not a valid libtool object"
3411 deplibs
="$deplibs $arg"
3412 old_deplibs
="$old_deplibs $arg"
3417 # A libtool-controlled library.
3419 if test "$prev" = dlfiles
; then
3420 # This library was specified with -dlopen.
3421 dlfiles
="$dlfiles $arg"
3423 elif test "$prev" = dlprefiles
; then
3424 # The library was specified with -dlpreopen.
3425 dlprefiles
="$dlprefiles $arg"
3428 deplibs
="$deplibs $arg"
3433 # Some other compiler argument.
3435 # Unknown arguments in both finalize_command and compile_command need
3436 # to be aesthetically quoted because they are evaled later.
3437 func_quote_for_eval
"$arg"
3438 arg
="$func_quote_for_eval_result"
3442 # Now actually substitute the argument into the commands.
3443 if test -n "$arg"; then
3444 compile_command
="$compile_command $arg"
3445 finalize_command
="$finalize_command $arg"
3447 done # argument parsing loop
3449 test -n "$prev" && \
3450 func_fatal_help
"the \`$prevarg' option requires an argument"
3452 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
3453 eval arg
=\"$export_dynamic_flag_spec\"
3454 compile_command
="$compile_command $arg"
3455 finalize_command
="$finalize_command $arg"
3459 # calculate the name of the file, without its directory
3460 func_basename
"$output"
3461 outputname
="$func_basename_result"
3462 libobjs_save
="$libobjs"
3464 if test -n "$shlibpath_var"; then
3465 # get the directories listed in $shlibpath_var
3466 eval shlib_search_path
=\
`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
3470 eval sys_lib_search_path
=\"$sys_lib_search_path_spec\"
3471 eval sys_lib_dlsearch_path
=\"$sys_lib_dlsearch_path_spec\"
3473 func_dirname
"$output" "/" ""
3474 output_objdir
="$func_dirname_result$objdir"
3475 # Create the object directory.
3476 func_mkdir_p
"$output_objdir"
3478 # Determine the type of output
3481 func_fatal_help
"you must specify an output file"
3483 *.
$libext) linkmode
=oldlib
;;
3484 *.lo
| *.
$objext) linkmode
=obj
;;
3485 *.la
) linkmode
=lib
;;
3486 *) linkmode
=prog
;; # Anything else should be a program.
3492 # Find all interdependent deplibs by searching for libraries
3493 # that are linked more than once (e.g. -la -lb -la)
3494 for deplib
in $deplibs; do
3495 if $opt_duplicate_deps ; then
3497 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
3500 libs
="$libs $deplib"
3503 if test "$linkmode" = lib
; then
3504 libs
="$predeps $libs $compiler_lib_search_path $postdeps"
3506 # Compute libraries that are listed more than once in $predeps
3507 # $postdeps and mark them as special (i.e., whose duplicates are
3508 # not to be eliminated).
3510 if $opt_duplicate_compiler_generated_deps; then
3511 for pre_post_dep
in $predeps $postdeps; do
3512 case "$pre_post_deps " in
3513 *" $pre_post_dep "*) specialdeplibs
="$specialdeplibs $pre_post_deps" ;;
3515 pre_post_deps
="$pre_post_deps $pre_post_dep"
3524 need_relink
=no
# whether we're linking any uninstalled libtool libraries
3525 notinst_deplibs
= # not-installed libtool libraries
3526 notinst_path
= # paths that contain not-installed libtool libraries
3530 passes
="conv dlpreopen link"
3531 for file in $dlfiles $dlprefiles; do
3535 func_fatal_help
"libraries can \`-dlopen' only libtool libraries: $file"
3546 passes
="conv scan dlopen dlpreopen link"
3552 for pass
in $passes; do
3553 # The preopen pass in lib mode reverses $deplibs; put it back here
3554 # so that -L comes before libs that need it for instance...
3555 if test "$linkmode,$pass" = "lib,link"; then
3556 ## FIXME: Find the place where the list is rebuilt in the wrong
3557 ## order, and fix it there properly
3559 for deplib
in $deplibs; do
3560 tmp_deplibs
="$deplib $tmp_deplibs"
3562 deplibs
="$tmp_deplibs"
3565 if test "$linkmode,$pass" = "lib,link" ||
3566 test "$linkmode,$pass" = "prog,scan"; then
3570 if test "$linkmode" = prog
; then
3572 dlopen
) libs
="$dlfiles" ;;
3573 dlpreopen
) libs
="$dlprefiles" ;;
3574 link
) libs
="$deplibs %DEPLIBS% $dependency_libs" ;;
3577 if test "$linkmode,$pass" = "lib,dlpreopen"; then
3578 # Collect and forward deplibs of preopened libtool libs
3579 for lib
in $dlprefiles; do
3580 # Ignore non-libtool-libs
3583 *.la
) func_source
"$lib" ;;
3586 # Collect preopened libtool deplibs, except any this library
3587 # has declared as weak libs
3588 for deplib
in $dependency_libs; do
3589 deplib_base
=`$ECHO "X$deplib" | $Xsed -e "$basename"`
3590 case " $weak_libs " in
3591 *" $deplib_base "*) ;;
3592 *) deplibs
="$deplibs $deplib" ;;
3598 if test "$pass" = dlopen
; then
3599 # Collect dlpreopened libraries
3600 save_deplibs
="$deplibs"
3604 for deplib
in $libs; do
3608 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
3609 if test "$linkmode,$pass" = "prog,link"; then
3610 compile_deplibs
="$deplib $compile_deplibs"
3611 finalize_deplibs
="$deplib $finalize_deplibs"
3613 compiler_flags
="$compiler_flags $deplib"
3614 if test "$linkmode" = lib
; then
3615 case "$new_inherited_linker_flags " in
3617 * ) new_inherited_linker_flags
="$new_inherited_linker_flags $deplib" ;;
3624 if test "$linkmode" != lib
&& test "$linkmode" != prog
; then
3625 func_warning
"\`-l' is ignored for archives/objects"
3628 func_stripname
'-l' '' "$deplib"
3629 name
=$func_stripname_result
3630 for searchdir
in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
3631 for search_ext
in .la
$std_shrext .so .a
; do
3632 # Search the libtool library
3633 lib
="$searchdir/lib${name}${search_ext}"
3634 if test -f "$lib"; then
3635 if test "$search_ext" = ".la"; then
3644 if test "$found" != yes; then
3645 # deplib doesn't seem to be a libtool library
3646 if test "$linkmode,$pass" = "prog,link"; then
3647 compile_deplibs
="$deplib $compile_deplibs"
3648 finalize_deplibs
="$deplib $finalize_deplibs"
3650 deplibs
="$deplib $deplibs"
3651 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
3654 else # deplib is a libtool library
3655 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
3656 # We need to do some special things here, and not later.
3657 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3658 case " $predeps $postdeps " in
3660 if func_lalib_p
"$lib"; then
3664 for l
in $old_library $library_names; do
3667 if test "X$ll" = "X$old_library" ; then # only static version available
3669 func_dirname
"$lib" "" "."
3670 ladir
="$func_dirname_result"
3671 lib
=$ladir/$old_library
3672 if test "$linkmode,$pass" = "prog,link"; then
3673 compile_deplibs
="$deplib $compile_deplibs"
3674 finalize_deplibs
="$deplib $finalize_deplibs"
3676 deplibs
="$deplib $deplibs"
3677 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
3689 if test "$linkmode,$pass" = "prog,link"; then
3690 compile_deplibs
="$deplib $compile_deplibs"
3691 finalize_deplibs
="$deplib $finalize_deplibs"
3693 deplibs
="$deplib $deplibs"
3694 if test "$linkmode" = lib
; then
3695 case "$new_inherited_linker_flags " in
3697 * ) new_inherited_linker_flags
="$new_inherited_linker_flags $deplib" ;;
3706 deplibs
="$deplib $deplibs"
3707 test "$pass" = conv
&& continue
3708 newdependency_libs
="$deplib $newdependency_libs"
3709 func_stripname
'-L' '' "$deplib"
3710 newlib_search_path
="$newlib_search_path $func_stripname_result"
3713 if test "$pass" = conv
; then
3714 deplibs
="$deplib $deplibs"
3717 if test "$pass" = scan
; then
3718 deplibs
="$deplib $deplibs"
3720 compile_deplibs
="$deplib $compile_deplibs"
3721 finalize_deplibs
="$deplib $finalize_deplibs"
3723 func_stripname
'-L' '' "$deplib"
3724 newlib_search_path
="$newlib_search_path $func_stripname_result"
3727 func_warning
"\`-L' is ignored for archives/objects"
3733 if test "$pass" = link
; then
3734 func_stripname
'-R' '' "$deplib"
3735 dir
=$func_stripname_result
3736 # Make sure the xrpath contains only unique directories.
3739 *) xrpath
="$xrpath $dir" ;;
3742 deplibs
="$deplib $deplibs"
3745 *.la
) lib
="$deplib" ;;
3747 if test "$pass" = conv
; then
3748 deplibs
="$deplib $deplibs"
3753 # Linking convenience modules into shared libraries is allowed,
3754 # but linking other static libraries is non-portable.
3755 case " $dlpreconveniencelibs " in
3759 case $deplibs_check_method in
3761 set dummy
$deplibs_check_method; shift
3762 match_pattern_regex
=`expr "$deplibs_check_method" : "$1 \(.*\)"`
3763 if eval "\$ECHO \"X$deplib\"" 2>/dev
/null
| $Xsed -e 10q \
3764 | $EGREP "$match_pattern_regex" > /dev
/null
; then
3772 if test "$valid_a_lib" != yes; then
3774 $ECHO "*** Warning: Trying to link with static lib archive $deplib."
3775 $ECHO "*** I have the capability to make that library automatically link in when"
3776 $ECHO "*** you link to this library. But I can only do this if you have a"
3777 $ECHO "*** shared version of the library, which you do not appear to have"
3778 $ECHO "*** because the file extensions .$libext of this argument makes me believe"
3779 $ECHO "*** that it is just a static archive that I should not use here."
3782 $ECHO "*** Warning: Linking the shared library $output against the"
3783 $ECHO "*** static library $deplib is not portable!"
3784 deplibs
="$deplib $deplibs"
3791 if test "$pass" != link
; then
3792 deplibs
="$deplib $deplibs"
3794 compile_deplibs
="$deplib $compile_deplibs"
3795 finalize_deplibs
="$deplib $finalize_deplibs"
3802 if test "$pass" = conv
; then
3803 deplibs
="$deplib $deplibs"
3804 elif test "$linkmode" = prog
; then
3805 if test "$pass" = dlpreopen
|| test "$dlopen_support" != yes || test "$build_libtool_libs" = no
; then
3806 # If there is no dlopen support or we're linking statically,
3807 # we need to preload.
3808 newdlprefiles
="$newdlprefiles $deplib"
3809 compile_deplibs
="$deplib $compile_deplibs"
3810 finalize_deplibs
="$deplib $finalize_deplibs"
3812 newdlfiles
="$newdlfiles $deplib"
3823 if test "$found" = yes || test -f "$lib"; then :
3825 func_fatal_error
"cannot find the library \`$lib' or unhandled argument \`$deplib'"
3828 # Check to see that this really is a libtool archive.
3829 func_lalib_unsafe_p
"$lib" \
3830 || func_fatal_error
"\`$lib' is not a valid libtool archive"
3832 func_dirname
"$lib" "" "."
3833 ladir
="$func_dirname_result"
3841 inherited_linker_flags
=
3842 # If the library was installed with an old release of libtool,
3843 # it will not redefine variables installed, or shouldnotlink
3852 # Convert "-framework foo" to "foo.ltframework"
3853 if test -n "$inherited_linker_flags"; then
3854 tmp_inherited_linker_flags
=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
3855 for tmp_inherited_linker_flag
in $tmp_inherited_linker_flags; do
3856 case " $new_inherited_linker_flags " in
3857 *" $tmp_inherited_linker_flag "*) ;;
3858 *) new_inherited_linker_flags
="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
3862 dependency_libs
=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
3863 if test "$linkmode,$pass" = "prog,link"; then
3864 compile_deplibs
="$new_inherited_linker_flags $compile_deplibs"
3865 finalize_deplibs
="$new_inherited_linker_flags $finalize_deplibs"
3867 compiler_flags
="$compiler_flags $inherited_linker_flags"
3869 if test "$linkmode,$pass" = "lib,link" ||
3870 test "$linkmode,$pass" = "prog,scan" ||
3871 { test "$linkmode" != prog
&& test "$linkmode" != lib
; }; then
3872 test -n "$dlopen" && dlfiles
="$dlfiles $dlopen"
3873 test -n "$dlpreopen" && dlprefiles
="$dlprefiles $dlpreopen"
3876 if test "$pass" = conv
; then
3877 # Only check for convenience libraries
3878 deplibs
="$lib $deplibs"
3879 if test -z "$libdir"; then
3880 if test -z "$old_library"; then
3881 func_fatal_error
"cannot find name of link library for \`$lib'"
3883 # It is a libtool convenience library, so add in its objects.
3884 convenience
="$convenience $ladir/$objdir/$old_library"
3885 old_convenience
="$old_convenience $ladir/$objdir/$old_library"
3886 elif test "$linkmode" != prog
&& test "$linkmode" != lib
; then
3887 func_fatal_error
"\`$lib' is not a convenience library"
3890 for deplib
in $dependency_libs; do
3891 deplibs
="$deplib $deplibs"
3892 if $opt_duplicate_deps ; then
3893 case "$tmp_libs " in
3894 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
3897 tmp_libs
="$tmp_libs $deplib"
3903 # Get the name of the library we link against.
3905 for l
in $old_library $library_names; do
3908 if test -z "$linklib"; then
3909 func_fatal_error
"cannot find name of link library for \`$lib'"
3912 # This library was specified with -dlopen.
3913 if test "$pass" = dlopen
; then
3914 if test -z "$libdir"; then
3915 func_fatal_error
"cannot -dlopen a convenience library: \`$lib'"
3917 if test -z "$dlname" ||
3918 test "$dlopen_support" != yes ||
3919 test "$build_libtool_libs" = no
; then
3920 # If there is no dlname, no dlopen support or we're linking
3921 # statically, we need to preload. We also need to preload any
3922 # dependent libraries so libltdl's deplib preloader doesn't
3923 # bomb out in the load deplibs phase.
3924 dlprefiles
="$dlprefiles $lib $dependency_libs"
3926 newdlfiles
="$newdlfiles $lib"
3931 # We need an absolute path.
3933 [\\/]* | [A
-Za-z]:[\\/]*) abs_ladir
="$ladir" ;;
3935 abs_ladir
=`cd "$ladir" && pwd`
3936 if test -z "$abs_ladir"; then
3937 func_warning
"cannot determine absolute directory name of \`$ladir'"
3938 func_warning
"passing it literally to the linker, although it might fail"
3943 func_basename
"$lib"
3944 laname
="$func_basename_result"
3946 # Find the relevant object directory and library name.
3947 if test "X$installed" = Xyes
; then
3948 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
3949 func_warning
"library \`$lib' was moved."
3957 test "X$hardcode_automatic" = Xyes
&& avoidtemprpath
=yes
3959 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
3962 # Remove this search path later
3963 notinst_path
="$notinst_path $abs_ladir"
3965 dir
="$ladir/$objdir"
3966 absdir
="$abs_ladir/$objdir"
3967 # Remove this search path later
3968 notinst_path
="$notinst_path $abs_ladir"
3970 fi # $installed = yes
3971 func_stripname
'lib' '.la' "$laname"
3972 name
=$func_stripname_result
3974 # This library was specified with -dlpreopen.
3975 if test "$pass" = dlpreopen
; then
3976 if test -z "$libdir" && test "$linkmode" = prog
; then
3977 func_fatal_error
"only libraries may -dlpreopen a convenience library: \`$lib'"
3979 # Prefer using a static library (so that no silly _DYNAMIC symbols
3980 # are required to link).
3981 if test -n "$old_library"; then
3982 newdlprefiles
="$newdlprefiles $dir/$old_library"
3983 # Keep a list of preopened convenience libraries to check
3984 # that they are being used correctly in the link pass.
3985 test -z "$libdir" && \
3986 dlpreconveniencelibs
="$dlpreconveniencelibs $dir/$old_library"
3987 # Otherwise, use the dlname, so that lt_dlopen finds it.
3988 elif test -n "$dlname"; then
3989 newdlprefiles
="$newdlprefiles $dir/$dlname"
3991 newdlprefiles
="$newdlprefiles $dir/$linklib"
3993 fi # $pass = dlpreopen
3995 if test -z "$libdir"; then
3996 # Link the convenience library
3997 if test "$linkmode" = lib
; then
3998 deplibs
="$dir/$old_library $deplibs"
3999 elif test "$linkmode,$pass" = "prog,link"; then
4000 compile_deplibs
="$dir/$old_library $compile_deplibs"
4001 finalize_deplibs
="$dir/$old_library $finalize_deplibs"
4003 deplibs
="$lib $deplibs" # used for prog,scan pass
4009 if test "$linkmode" = prog
&& test "$pass" != link
; then
4010 newlib_search_path
="$newlib_search_path $ladir"
4011 deplibs
="$lib $deplibs"
4014 if test "$link_all_deplibs" != no
|| test -z "$library_names" ||
4015 test "$build_libtool_libs" = no
; then
4020 for deplib
in $dependency_libs; do
4022 -L*) func_stripname
'-L' '' "$deplib"
4023 newlib_search_path
="$newlib_search_path $func_stripname_result"
4026 # Need to link against all dependency_libs?
4027 if test "$linkalldeplibs" = yes; then
4028 deplibs
="$deplib $deplibs"
4030 # Need to hardcode shared library paths
4031 # or/and link against static libraries
4032 newdependency_libs
="$deplib $newdependency_libs"
4034 if $opt_duplicate_deps ; then
4035 case "$tmp_libs " in
4036 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
4039 tmp_libs
="$tmp_libs $deplib"
4042 fi # $linkmode = prog...
4044 if test "$linkmode,$pass" = "prog,link"; then
4045 if test -n "$library_names" &&
4046 { test "$prefer_static_libs" = no
|| test -z "$old_library"; }; then
4047 # We need to hardcode the library path
4048 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
4049 # Make sure the rpath contains only unique directories.
4050 case "$temp_rpath " in
4052 *) temp_rpath
="$temp_rpath$absdir:" ;;
4056 # Hardcode the library path.
4057 # Skip directories that are in the system default run-time
4059 case " $sys_lib_dlsearch_path " in
4062 case "$compile_rpath " in
4064 *) compile_rpath
="$compile_rpath $absdir"
4068 case " $sys_lib_dlsearch_path " in
4071 case "$finalize_rpath " in
4073 *) finalize_rpath
="$finalize_rpath $libdir"
4077 fi # $linkmode,$pass = prog,link...
4079 if test "$alldeplibs" = yes &&
4080 { test "$deplibs_check_method" = pass_all
||
4081 { test "$build_libtool_libs" = yes &&
4082 test -n "$library_names"; }; }; then
4083 # We only need to search for static libraries
4088 link_static
=no
# Whether the deplib will be linked statically
4089 use_static_libs
=$prefer_static_libs
4090 if test "$use_static_libs" = built
&& test "$installed" = yes; then
4093 if test -n "$library_names" &&
4094 { test "$use_static_libs" = no
|| test -z "$old_library"; }; then
4097 # No point in relinking DLLs because paths are not encoded
4098 notinst_deplibs
="$notinst_deplibs $lib"
4102 if test "$installed" = no
; then
4103 notinst_deplibs
="$notinst_deplibs $lib"
4108 # This is a shared library
4110 # Warn about portability, can't link against -module's on some
4111 # systems (darwin). Don't bleat about dlopened modules though!
4113 for dlpremoduletest
in $dlprefiles; do
4114 if test "X$dlpremoduletest" = "X$lib"; then
4115 dlopenmodule
="$dlpremoduletest"
4119 if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link
; then
4121 if test "$linkmode" = prog
; then
4122 $ECHO "*** Warning: Linking the executable $output against the loadable module"
4124 $ECHO "*** Warning: Linking the shared library $output against the loadable module"
4126 $ECHO "*** $linklib is not portable!"
4128 if test "$linkmode" = lib
&&
4129 test "$hardcode_into_libs" = yes; then
4130 # Hardcode the library path.
4131 # Skip directories that are in the system default run-time
4133 case " $sys_lib_dlsearch_path " in
4136 case "$compile_rpath " in
4138 *) compile_rpath
="$compile_rpath $absdir"
4142 case " $sys_lib_dlsearch_path " in
4145 case "$finalize_rpath " in
4147 *) finalize_rpath
="$finalize_rpath $libdir"
4153 if test -n "$old_archive_from_expsyms_cmds"; then
4154 # figure out the soname
4155 set dummy
$library_names
4159 libname
=`eval "\\$ECHO \"$libname_spec\""`
4160 # use dlname if we got it. it's perfectly good, no?
4161 if test -n "$dlname"; then
4163 elif test -n "$soname_spec"; then
4167 major
=`expr $current - $age`
4171 eval soname
=\"$soname_spec\"
4176 # Make a new name for the extract_expsyms_cmds to use
4178 func_basename
"$soroot"
4179 soname
="$func_basename_result"
4180 func_stripname
'lib' '.dll' "$soname"
4181 newlib
=libimp
-$func_stripname_result.a
4183 # If the library has no export list, then create one now
4184 if test -f "$output_objdir/$soname-def"; then :
4186 func_echo
"extracting exported symbol list from \`$soname'"
4187 func_execute_cmds
"$extract_expsyms_cmds" 'exit $?'
4191 if test -f "$output_objdir/$newlib"; then :; else
4192 func_echo
"generating import library for \`$soname'"
4193 func_execute_cmds
"$old_archive_from_expsyms_cmds" 'exit $?'
4195 # make sure the library variables are pointing to the new library
4198 fi # test -n "$old_archive_from_expsyms_cmds"
4200 if test "$linkmode" = prog
|| test "$mode" != relink
; then
4205 case $hardcode_action in
4206 immediate
| unsupported
)
4207 if test "$hardcode_direct" = no
; then
4210 *-*-sco3.2v5.0.
[024]*) add_dir
="-L$dir" ;;
4211 *-*-sysv4*uw2
*) add_dir
="-L$dir" ;;
4212 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.
[01].
[10]* | \
4213 *-*-unixware7*) add_dir
="-L$dir" ;;
4215 # if the lib is a (non-dlopened) module then we can not
4216 # link against it, someone is ignoring the earlier warnings
4217 if /usr
/bin
/file -L $add 2> /dev
/null
|
4218 $GREP ": [^:]* bundle" >/dev
/null
; then
4219 if test "X$dlopenmodule" != "X$lib"; then
4220 $ECHO "*** Warning: lib $linklib is a module, not a shared library"
4221 if test -z "$old_library" ; then
4223 $ECHO "*** And there doesn't seem to be a static archive available"
4224 $ECHO "*** The link will probably fail, sorry"
4226 add
="$dir/$old_library"
4228 elif test -n "$old_library"; then
4229 add
="$dir/$old_library"
4233 elif test "$hardcode_minus_L" = no
; then
4235 *-*-sunos*) add_shlibpath
="$dir" ;;
4239 elif test "$hardcode_shlibpath_var" = no
; then
4240 add_shlibpath
="$dir"
4247 if test "$hardcode_direct" = yes; then
4249 elif test "$hardcode_minus_L" = yes; then
4251 # Try looking first in the location we're being installed to.
4252 if test -n "$inst_prefix_dir"; then
4255 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
4260 elif test "$hardcode_shlibpath_var" = yes; then
4261 add_shlibpath
="$dir"
4270 if test "$lib_linked" != yes; then
4271 func_fatal_configuration
"unsupported hardcode properties"
4274 if test -n "$add_shlibpath"; then
4275 case :$compile_shlibpath: in
4276 *":$add_shlibpath:"*) ;;
4277 *) compile_shlibpath
="$compile_shlibpath$add_shlibpath:" ;;
4280 if test "$linkmode" = prog
; then
4281 test -n "$add_dir" && compile_deplibs
="$add_dir $compile_deplibs"
4282 test -n "$add" && compile_deplibs
="$add $compile_deplibs"
4284 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
4285 test -n "$add" && deplibs
="$add $deplibs"
4286 if test "$hardcode_direct" != yes &&
4287 test "$hardcode_minus_L" != yes &&
4288 test "$hardcode_shlibpath_var" = yes; then
4289 case :$finalize_shlibpath: in
4291 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
4297 if test "$linkmode" = prog
|| test "$mode" = relink
; then
4301 # Finalize command for both is simple: just hardcode it.
4302 if test "$hardcode_direct" = yes; then
4303 add
="$libdir/$linklib"
4304 elif test "$hardcode_minus_L" = yes; then
4307 elif test "$hardcode_shlibpath_var" = yes; then
4308 case :$finalize_shlibpath: in
4310 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
4313 elif test "$hardcode_automatic" = yes; then
4314 if test -n "$inst_prefix_dir" &&
4315 test -f "$inst_prefix_dir$libdir/$linklib" ; then
4316 add
="$inst_prefix_dir$libdir/$linklib"
4318 add
="$libdir/$linklib"
4321 # We cannot seem to hardcode it, guess we'll fake it.
4323 # Try looking first in the location we're being installed to.
4324 if test -n "$inst_prefix_dir"; then
4327 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
4334 if test "$linkmode" = prog
; then
4335 test -n "$add_dir" && finalize_deplibs
="$add_dir $finalize_deplibs"
4336 test -n "$add" && finalize_deplibs
="$add $finalize_deplibs"
4338 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
4339 test -n "$add" && deplibs
="$add $deplibs"
4342 elif test "$linkmode" = prog
; then
4343 # Here we assume that one of hardcode_direct or hardcode_minus_L
4344 # is not unsupported. This is valid on all known static and
4346 if test "$hardcode_direct" != unsupported
; then
4347 test -n "$old_library" && linklib
="$old_library"
4348 compile_deplibs
="$dir/$linklib $compile_deplibs"
4349 finalize_deplibs
="$dir/$linklib $finalize_deplibs"
4351 compile_deplibs
="-l$name -L$dir $compile_deplibs"
4352 finalize_deplibs
="-l$name -L$dir $finalize_deplibs"
4354 elif test "$build_libtool_libs" = yes; then
4355 # Not a shared library
4356 if test "$deplibs_check_method" != pass_all
; then
4357 # We're trying link a shared library against a static one
4358 # but the system doesn't support it.
4360 # Just print a warning and add the library to dependency_libs so
4361 # that the program can be linked against the static library.
4363 $ECHO "*** Warning: This system can not link to static lib archive $lib."
4364 $ECHO "*** I have the capability to make that library automatically link in when"
4365 $ECHO "*** you link to this library. But I can only do this if you have a"
4366 $ECHO "*** shared version of the library, which you do not appear to have."
4367 if test "$module" = yes; then
4368 $ECHO "*** But as you try to build a module library, libtool will still create "
4369 $ECHO "*** a static module, that should work as long as the dlopening application"
4370 $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
4371 if test -z "$global_symbol_pipe"; then
4373 $ECHO "*** However, this would only work if libtool was able to extract symbol"
4374 $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
4375 $ECHO "*** not find such a program. So, this module is probably useless."
4376 $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
4378 if test "$build_old_libs" = no
; then
4379 build_libtool_libs
=module
4382 build_libtool_libs
=no
4386 deplibs
="$dir/$old_library $deplibs"
4389 fi # link shared/static library?
4391 if test "$linkmode" = lib
; then
4392 if test -n "$dependency_libs" &&
4393 { test "$hardcode_into_libs" != yes ||
4394 test "$build_old_libs" = yes ||
4395 test "$link_static" = yes; }; then
4396 # Extract -R from dependency_libs
4398 for libdir
in $dependency_libs; do
4400 -R*) func_stripname
'-R' '' "$libdir"
4401 temp_xrpath
=$func_stripname_result
4403 *" $temp_xrpath "*) ;;
4404 *) xrpath
="$xrpath $temp_xrpath";;
4406 *) temp_deplibs
="$temp_deplibs $libdir";;
4409 dependency_libs
="$temp_deplibs"
4412 newlib_search_path
="$newlib_search_path $absdir"
4413 # Link against this library
4414 test "$link_static" = no
&& newdependency_libs
="$abs_ladir/$laname $newdependency_libs"
4415 # ... and its dependency_libs
4417 for deplib
in $dependency_libs; do
4418 newdependency_libs
="$deplib $newdependency_libs"
4419 if $opt_duplicate_deps ; then
4420 case "$tmp_libs " in
4421 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
4424 tmp_libs
="$tmp_libs $deplib"
4427 if test "$link_all_deplibs" != no
; then
4428 # Add the search paths of all dependency libraries
4429 for deplib
in $dependency_libs; do
4431 -L*) path
="$deplib" ;;
4433 func_dirname
"$deplib" "" "."
4434 dir
="$func_dirname_result"
4435 # We need an absolute path.
4437 [\\/]* | [A
-Za-z]:[\\/]*) absdir
="$dir" ;;
4439 absdir
=`cd "$dir" && pwd`
4440 if test -z "$absdir"; then
4441 func_warning
"cannot determine absolute directory name of \`$dir'"
4446 if $GREP "^installed=no" $deplib > /dev
/null
; then
4450 eval deplibrary_names
=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
4451 if test -n "$deplibrary_names" ; then
4452 for tmp
in $deplibrary_names ; do
4455 if test -f "$absdir/$objdir/$depdepl" ; then
4456 depdepl
="$absdir/$objdir/$depdepl"
4457 darwin_install_name
=`otool -L $depdepl | $SED -n -e '3q;2,2p' | $SED -e 's/(.*//'`
4458 darwin_install_name
=`$ECHO $darwin_install_name`
4459 compiler_flags
="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
4460 linker_flags
="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
4466 path
="-L$absdir/$objdir"
4470 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
4471 test -z "$libdir" && \
4472 func_fatal_error
"\`$deplib' is not a valid libtool archive"
4473 test "$absdir" != "$libdir" && \
4474 func_warning
"\`$deplib' seems to be moved"
4480 case " $deplibs " in
4482 *) deplibs
="$path $deplibs" ;;
4485 fi # link_all_deplibs != no
4487 done # for deplib in $libs
4488 dependency_libs
="$newdependency_libs"
4489 if test "$pass" = dlpreopen
; then
4490 # Link the dlpreopened libraries before other libraries
4491 for deplib
in $save_deplibs; do
4492 deplibs
="$deplib $deplibs"
4495 if test "$pass" != dlopen
; then
4496 if test "$pass" != conv
; then
4497 # Make sure lib_search_path contains only unique directories.
4499 for dir
in $newlib_search_path; do
4500 case "$lib_search_path " in
4502 *) lib_search_path
="$lib_search_path $dir" ;;
4508 if test "$linkmode,$pass" != "prog,link"; then
4511 vars
="compile_deplibs finalize_deplibs"
4513 for var
in $vars dependency_libs
; do
4514 # Add libraries to $var in reverse order
4515 eval tmp_libs
=\"\$
$var\"
4517 for deplib
in $tmp_libs; do
4518 # FIXME: Pedantically, this is the right thing to do, so
4519 # that some nasty dependency loop isn't accidentally
4521 #new_libs="$deplib $new_libs"
4522 # Pragmatically, this seems to cause very few problems in
4525 -L*) new_libs
="$deplib $new_libs" ;;
4528 # And here is the reason: when a library appears more
4529 # than once as an explicit dependence of a library, or
4530 # is implicitly linked in more than once by the
4531 # compiler, it is considered special, and multiple
4532 # occurrences thereof are not removed. Compare this
4533 # with having the same library being listed as a
4534 # dependency of multiple other libraries: in this case,
4535 # we know (pedantically, we assume) the library does not
4536 # need to be listed more than once, so we keep only the
4537 # last copy. This is not always right, but it is rare
4538 # enough that we require users that really mean to play
4539 # such unportable linking tricks to link the library
4540 # using -Wl,-lname, so that libtool does not consider it
4541 # for duplicate removal.
4542 case " $specialdeplibs " in
4543 *" $deplib "*) new_libs
="$deplib $new_libs" ;;
4545 case " $new_libs " in
4547 *) new_libs
="$deplib $new_libs" ;;
4555 for deplib
in $new_libs; do
4558 case " $tmp_libs " in
4560 *) tmp_libs
="$tmp_libs $deplib" ;;
4563 *) tmp_libs
="$tmp_libs $deplib" ;;
4566 eval $var=\"$tmp_libs\"
4569 # Last step: remove runtime libs from dependency_libs
4570 # (they stay in deplibs)
4572 for i
in $dependency_libs ; do
4573 case " $predeps $postdeps $compiler_lib_search_path " in
4578 if test -n "$i" ; then
4579 tmp_libs
="$tmp_libs $i"
4582 dependency_libs
=$tmp_libs
4584 if test "$linkmode" = prog
; then
4585 dlfiles
="$newdlfiles"
4587 if test "$linkmode" = prog
|| test "$linkmode" = lib
; then
4588 dlprefiles
="$newdlprefiles"
4593 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no
; then
4594 func_warning
"\`-dlopen' is ignored for archives"
4597 test -n "$deplibs" && \
4598 func_warning
"\`-l' and \`-L' are ignored for archives"
4601 test -n "$rpath" && \
4602 func_warning
"\`-rpath' is ignored for archives"
4604 test -n "$xrpath" && \
4605 func_warning
"\`-R' is ignored for archives"
4607 test -n "$vinfo" && \
4608 func_warning
"\`-version-info/-version-number' is ignored for archives"
4610 test -n "$release" && \
4611 func_warning
"\`-release' is ignored for archives"
4613 test -n "$export_symbols$export_symbols_regex" && \
4614 func_warning
"\`-export-symbols' is ignored for archives"
4616 # Now set the variables for building old libraries.
4617 build_libtool_libs
=no
4619 objs
="$objs$old_deplibs"
4623 # Make sure we only generate libraries of the form `libNAME.la'.
4626 func_stripname
'lib' '.la' "$outputname"
4627 name
=$func_stripname_result
4628 eval shared_ext
=\"$shrext_cmds\"
4629 eval libname
=\"$libname_spec\"
4632 test "$module" = no
&& \
4633 func_fatal_help
"libtool library \`$output' must begin with \`lib'"
4635 if test "$need_lib_prefix" != no
; then
4636 # Add the "lib" prefix for modules if required
4637 func_stripname
'' '.la' "$outputname"
4638 name
=$func_stripname_result
4639 eval shared_ext
=\"$shrext_cmds\"
4640 eval libname
=\"$libname_spec\"
4642 func_stripname
'' '.la' "$outputname"
4643 libname
=$func_stripname_result
4648 if test -n "$objs"; then
4649 if test "$deplibs_check_method" != pass_all
; then
4650 func_fatal_error
"cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
4653 $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
4654 $ECHO "*** objects $objs is not portable!"
4655 libobjs
="$libobjs $objs"
4659 test "$dlself" != no
&& \
4660 func_warning
"\`-dlopen self' is ignored for libtool libraries"
4664 test "$#" -gt 1 && \
4665 func_warning
"ignoring multiple \`-rpath's for a libtool library"
4670 if test -z "$rpath"; then
4671 if test "$build_libtool_libs" = yes; then
4672 # Building a libtool convenience library.
4673 # Some compilers have problems with a `.al' extension so
4674 # convenience libraries should have the same extension an
4675 # archive normally would.
4676 oldlibs
="$output_objdir/$libname.$libext $oldlibs"
4677 build_libtool_libs
=convenience
4681 test -n "$vinfo" && \
4682 func_warning
"\`-version-info/-version-number' is ignored for convenience libraries"
4684 test -n "$release" && \
4685 func_warning
"\`-release' is ignored for convenience libraries"
4688 # Parse the version information argument.
4689 save_ifs
="$IFS"; IFS
=':'
4690 set dummy
$vinfo 0 0 0
4695 func_fatal_help
"too many parameters to \`-version-info'"
4697 # convert absolute version numbers to libtool ages
4698 # this retains compatibility with .la files and attempts
4699 # to make the code below a bit more comprehensible
4701 case $vinfo_number in
4705 number_revision
="$3"
4707 # There are really only two kinds -- those that
4708 # use the current revision as the major version
4709 # and those that subtract age and use age as
4710 # a minor version. But, then there is irix
4711 # which has an extra 1 added just for fun
4713 case $version_type in
4714 darwin
|linux
|osf
|windows
)
4715 current
=`expr $number_major + $number_minor`
4717 revision
="$number_revision"
4719 freebsd
-aout|freebsd
-elf|sunos
)
4720 current
="$number_major"
4721 revision
="$number_minor"
4725 current
=`expr $number_major + $number_minor - 1`
4727 revision
="$number_minor"
4738 # Check that each of the things are valid numbers.
4740 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]) ;;
4742 func_error
"CURRENT \`$current' must be a nonnegative integer"
4743 func_fatal_error
"\`$vinfo' is not valid version information"
4748 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]) ;;
4750 func_error
"REVISION \`$revision' must be a nonnegative integer"
4751 func_fatal_error
"\`$vinfo' is not valid version information"
4756 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]) ;;
4758 func_error
"AGE \`$age' must be a nonnegative integer"
4759 func_fatal_error
"\`$vinfo' is not valid version information"
4763 if test "$age" -gt "$current"; then
4764 func_error
"AGE \`$age' is greater than the current interface number \`$current'"
4765 func_fatal_error
"\`$vinfo' is not valid version information"
4768 # Calculate the version variables.
4772 case $version_type in
4776 # Like Linux, but with the current version available in
4777 # verstring for coding it into the library header
4778 major
=.
`expr $current - $age`
4779 versuffix
="$major.$age.$revision"
4780 # Darwin ld doesn't like 0 for these options...
4781 minor_current
=`expr $current + 1`
4782 verstring
="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
4787 versuffix
=".$current.$revision";
4792 versuffix
=".$current"
4796 major
=`expr $current - $age + 1`
4798 case $version_type in
4799 nonstopux
) verstring_prefix
=nonstopux
;;
4800 *) verstring_prefix
=sgi
;;
4802 verstring
="$verstring_prefix$major.$revision"
4804 # Add in all the interfaces that we are compatible with.
4806 while test "$loop" -ne 0; do
4807 iface
=`expr $revision - $loop`
4808 loop
=`expr $loop - 1`
4809 verstring
="$verstring_prefix$major.$iface:$verstring"
4812 # Before this point, $major must not contain `.'.
4814 versuffix
="$major.$revision"
4818 major
=.
`expr $current - $age`
4819 versuffix
="$major.$age.$revision"
4823 major
=.
`expr $current - $age`
4824 versuffix
=".$current.$age.$revision"
4825 verstring
="$current.$age.$revision"
4827 # Add in all the interfaces that we are compatible with.
4829 while test "$loop" -ne 0; do
4830 iface
=`expr $current - $loop`
4831 loop
=`expr $loop - 1`
4832 verstring
="$verstring:${iface}.0"
4835 # Make executables depend on our current version.
4836 verstring
="$verstring:${current}.0"
4841 versuffix
=".$current"
4846 versuffix
=".$current.$revision"
4850 # Use '-' rather than '.', since we only want one
4851 # extension on DOS 8.3 filesystems.
4852 major
=`expr $current - $age`
4857 func_fatal_configuration
"unknown library version type \`$version_type'"
4861 # Clear the version info if we defaulted, and they specified a release.
4862 if test -z "$vinfo" && test -n "$release"; then
4864 case $version_type in
4866 # we can't check for "0.0" in archive_cmds due to quoting
4867 # problems, so we reset it completely
4874 if test "$need_version" = no
; then
4881 # Remove version info from name if versioning should be avoided
4882 if test "$avoid_version" = yes && test "$need_version" = no
; then
4888 # Check to see if the archive will have undefined symbols.
4889 if test "$allow_undefined" = yes; then
4890 if test "$allow_undefined_flag" = unsupported
; then
4891 func_warning
"undefined symbols not allowed in $host shared libraries"
4892 build_libtool_libs
=no
4896 # Don't allow undefined symbols.
4897 allow_undefined_flag
="$no_undefined_flag"
4902 func_generate_dlsyms
"$libname" "$libname" "yes"
4903 libobjs
="$libobjs $symfileobj"
4905 if test "$mode" != relink
; then
4906 # Remove our outputs, but don't remove object files since they
4907 # may have been created when compiling PIC objects.
4909 tempremovelist
=`$ECHO "$output_objdir/*"`
4910 for p
in $tempremovelist; do
4914 $output_objdir/$outputname | $output_objdir/$libname.
* | $output_objdir/${libname}${release}.
*)
4915 if test "X$precious_files_regex" != "X"; then
4916 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev
/null
2>&1
4921 removelist
="$removelist $p"
4926 test -n "$removelist" && \
4927 func_show_eval
"${RM}r \$removelist"
4930 # Now set the variables for building old libraries.
4931 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience
; then
4932 oldlibs
="$oldlibs $output_objdir/$libname.$libext"
4934 # Transform .lo files to .o files.
4935 oldobjs
="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
4938 # Eliminate all temporary directories.
4939 for path
in $notinst_path; do
4940 lib_search_path
=`$ECHO "X$lib_search_path " | $Xsed -e 's% $path % %g'`
4941 deplibs
=`$ECHO "X$deplibs " | $Xsed -e 's% -L$path % %g'`
4942 dependency_libs
=`$ECHO "X$dependency_libs " | $Xsed -e 's% -L$path % %g'`
4945 if test -n "$xrpath"; then
4946 # If the user specified any rpath flags, then add them.
4948 for libdir
in $xrpath; do
4949 temp_xrpath
="$temp_xrpath -R$libdir"
4950 case "$finalize_rpath " in
4952 *) finalize_rpath
="$finalize_rpath $libdir" ;;
4955 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
4956 dependency_libs
="$temp_xrpath $dependency_libs"
4960 # Make sure dlfiles contains only unique files that won't be dlpreopened
4961 old_dlfiles
="$dlfiles"
4963 for lib
in $old_dlfiles; do
4964 case " $dlprefiles $dlfiles " in
4966 *) dlfiles
="$dlfiles $lib" ;;
4970 # Make sure dlprefiles contains only unique files
4971 old_dlprefiles
="$dlprefiles"
4973 for lib
in $old_dlprefiles; do
4974 case "$dlprefiles " in
4976 *) dlprefiles
="$dlprefiles $lib" ;;
4980 if test "$build_libtool_libs" = yes; then
4981 if test -n "$rpath"; then
4983 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
4984 # these systems don't actually have a c library (as such)!
4986 *-*-rhapsody* | *-*-darwin1.
[012])
4987 # Rhapsody C library is in the System framework
4988 deplibs
="$deplibs System.ltframework"
4991 # Don't link with libc until the a.out ld.so is fixed.
4993 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
4994 # Do not include libc due to us having libc/libc_r.
4996 *-*-sco3.2v5
* | *-*-sco5v6*)
4997 # Causes problems with __ctype
4999 *-*-sysv4.2uw2
* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
5000 # Compiler inserts libc in the correct place for threads to work
5003 # Add libc to deplibs on all other systems if necessary.
5004 if test "$build_libtool_need_lc" = "yes"; then
5005 deplibs
="$deplibs -lc"
5011 # Transform deplibs into only deplibs that can be linked in shared.
5013 libname_save
=$libname
5014 release_save
=$release
5015 versuffix_save
=$versuffix
5017 # I'm not sure if I'm treating the release correctly. I think
5018 # release should show up in the -l (ie -lgmp5) so we don't want to
5019 # add it in twice. Is that correct?
5025 case $deplibs_check_method in
5027 # Don't check for shared/static. Everything works.
5028 # This might be a little naive. We might want to check
5029 # whether the library exists or not. But this is on
5030 # osf3 & osf4 and I'm not really sure... Just
5031 # implementing what was already the behavior.
5035 # This code stresses the "libraries are programs" paradigm to its
5036 # limits. Maybe even breaks it. We compile a program, linking it
5037 # against the deplibs as a proxy for the library. Then we can check
5038 # whether they linked in statically or dynamically with ldd.
5039 $opt_dry_run || $RM conftest.c
5040 cat > conftest.c
<<EOF
5041 int main() { return 0; }
5043 $opt_dry_run || $RM conftest
5044 $LTCC $LTCFLAGS -o conftest conftest.c
$deplibs
5045 if test "$?" -eq 0 ; then
5046 ldd_output
=`ldd conftest`
5047 for i
in $deplibs; do
5048 name
=`expr $i : '-l\(.*\)'`
5049 # If $name is empty we are operating on a -L argument.
5050 if test "$name" != "" && test "$name" -ne "0"; then
5051 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
5052 case " $predeps $postdeps " in
5054 newdeplibs
="$newdeplibs $i"
5059 if test -n "$i" ; then
5060 libname
=`eval "\\$ECHO \"$libname_spec\""`
5061 deplib_matches
=`eval "\\$ECHO \"$library_names_spec\""`
5062 set dummy
$deplib_matches; shift
5064 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
5065 newdeplibs
="$newdeplibs $i"
5069 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
5070 $ECHO "*** I have the capability to make that library automatically link in when"
5071 $ECHO "*** you link to this library. But I can only do this if you have a"
5072 $ECHO "*** shared version of the library, which I believe you do not have"
5073 $ECHO "*** because a test_compile did reveal that the linker did not use it for"
5074 $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
5078 newdeplibs
="$newdeplibs $i"
5082 # Error occurred in the first compile. Let's try to salvage
5083 # the situation: Compile a separate program for each library.
5084 for i
in $deplibs; do
5085 name
=`expr $i : '-l\(.*\)'`
5086 # If $name is empty we are operating on a -L argument.
5087 if test "$name" != "" && test "$name" != "0"; then
5088 $opt_dry_run || $RM conftest
5089 $LTCC $LTCFLAGS -o conftest conftest.c
$i
5091 if test "$?" -eq 0 ; then
5092 ldd_output
=`ldd conftest`
5093 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
5094 case " $predeps $postdeps " in
5096 newdeplibs
="$newdeplibs $i"
5101 if test -n "$i" ; then
5102 libname
=`eval "\\$ECHO \"$libname_spec\""`
5103 deplib_matches
=`eval "\\$ECHO \"$library_names_spec\""`
5104 set dummy
$deplib_matches; shift
5106 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
5107 newdeplibs
="$newdeplibs $i"
5111 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
5112 $ECHO "*** I have the capability to make that library automatically link in when"
5113 $ECHO "*** you link to this library. But I can only do this if you have a"
5114 $ECHO "*** shared version of the library, which you do not appear to have"
5115 $ECHO "*** because a test_compile did reveal that the linker did not use this one"
5116 $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
5122 $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
5123 $ECHO "*** make it link in! You will probably need to install it or some"
5124 $ECHO "*** library that it depends on before this library will be fully"
5125 $ECHO "*** functional. Installing it before continuing would be even better."
5128 newdeplibs
="$newdeplibs $i"
5134 set dummy
$deplibs_check_method; shift
5135 file_magic_regex
=`expr "$deplibs_check_method" : "$1 \(.*\)"`
5136 for a_deplib
in $deplibs; do
5137 name
=`expr $a_deplib : '-l\(.*\)'`
5138 # If $name is empty we are operating on a -L argument.
5139 if test "$name" != "" && test "$name" != "0"; then
5140 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
5141 case " $predeps $postdeps " in
5143 newdeplibs
="$newdeplibs $a_deplib"
5148 if test -n "$a_deplib" ; then
5149 libname
=`eval "\\$ECHO \"$libname_spec\""`
5150 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
5151 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
5152 for potent_lib
in $potential_libs; do
5153 # Follow soft links.
5154 if ls -lLd "$potent_lib" 2>/dev
/null
|
5155 $GREP " -> " >/dev
/null
; then
5158 # The statement above tries to avoid entering an
5159 # endless loop below, in case of cyclic links.
5160 # We might still enter an endless loop, since a link
5161 # loop can be closed while we follow links,
5163 potlib
="$potent_lib"
5164 while test -h "$potlib" 2>/dev
/null
; do
5165 potliblink
=`ls -ld $potlib | ${SED} 's/.* -> //'`
5167 [\\/]* | [A
-Za-z]:[\\/]*) potlib
="$potliblink";;
5168 *) potlib
=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
5171 if eval $file_magic_cmd \"\
$potlib\" 2>/dev
/null
|
5173 $EGREP "$file_magic_regex" > /dev
/null
; then
5174 newdeplibs
="$newdeplibs $a_deplib"
5181 if test -n "$a_deplib" ; then
5184 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
5185 $ECHO "*** I have the capability to make that library automatically link in when"
5186 $ECHO "*** you link to this library. But I can only do this if you have a"
5187 $ECHO "*** shared version of the library, which you do not appear to have"
5188 $ECHO "*** because I did check the linker path looking for a file starting"
5189 if test -z "$potlib" ; then
5190 $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
5192 $ECHO "*** with $libname and none of the candidates passed a file format test"
5193 $ECHO "*** using a file magic. Last file checked: $potlib"
5197 # Add a -L argument.
5198 newdeplibs
="$newdeplibs $a_deplib"
5200 done # Gone through all deplibs.
5203 set dummy
$deplibs_check_method; shift
5204 match_pattern_regex
=`expr "$deplibs_check_method" : "$1 \(.*\)"`
5205 for a_deplib
in $deplibs; do
5206 name
=`expr $a_deplib : '-l\(.*\)'`
5207 # If $name is empty we are operating on a -L argument.
5208 if test -n "$name" && test "$name" != "0"; then
5209 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
5210 case " $predeps $postdeps " in
5212 newdeplibs
="$newdeplibs $a_deplib"
5217 if test -n "$a_deplib" ; then
5218 libname
=`eval "\\$ECHO \"$libname_spec\""`
5219 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
5220 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
5221 for potent_lib
in $potential_libs; do
5222 potlib
="$potent_lib" # see symlink-check above in file_magic test
5223 if eval "\$ECHO \"X$potent_lib\"" 2>/dev
/null
| $Xsed -e 10q
| \
5224 $EGREP "$match_pattern_regex" > /dev
/null
; then
5225 newdeplibs
="$newdeplibs $a_deplib"
5232 if test -n "$a_deplib" ; then
5235 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
5236 $ECHO "*** I have the capability to make that library automatically link in when"
5237 $ECHO "*** you link to this library. But I can only do this if you have a"
5238 $ECHO "*** shared version of the library, which you do not appear to have"
5239 $ECHO "*** because I did check the linker path looking for a file starting"
5240 if test -z "$potlib" ; then
5241 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
5243 $ECHO "*** with $libname and none of the candidates passed a file format test"
5244 $ECHO "*** using a regex pattern. Last file checked: $potlib"
5248 # Add a -L argument.
5249 newdeplibs
="$newdeplibs $a_deplib"
5251 done # Gone through all deplibs.
5255 tmp_deplibs
=`$ECHO "X $deplibs" | $Xsed \
5256 -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
5257 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
5258 for i
in $predeps $postdeps ; do
5259 # can't use Xsed below, because $i might contain '/'
5260 tmp_deplibs
=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
5263 if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' |
5264 $GREP .
>/dev
/null
; then
5266 if test "X$deplibs_check_method" = "Xnone"; then
5267 $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
5269 $ECHO "*** Warning: inter-library dependencies are not known to be supported."
5271 $ECHO "*** All declared inter-library dependencies are being dropped."
5276 versuffix
=$versuffix_save
5278 release
=$release_save
5279 libname
=$libname_save
5283 *-*-rhapsody* | *-*-darwin1.
[012])
5284 # On Rhapsody replace the C library with the System framework
5285 newdeplibs
=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
5289 if test "$droppeddeps" = yes; then
5290 if test "$module" = yes; then
5292 $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
5293 $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
5294 $ECHO "*** a static module, that should work as long as the dlopening"
5295 $ECHO "*** application is linked with the -dlopen flag."
5296 if test -z "$global_symbol_pipe"; then
5298 $ECHO "*** However, this would only work if libtool was able to extract symbol"
5299 $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
5300 $ECHO "*** not find such a program. So, this module is probably useless."
5301 $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
5303 if test "$build_old_libs" = no
; then
5304 oldlibs
="$output_objdir/$libname.$libext"
5305 build_libtool_libs
=module
5308 build_libtool_libs
=no
5311 $ECHO "*** The inter-library dependencies that have been dropped here will be"
5312 $ECHO "*** automatically added whenever a program is linked with this library"
5313 $ECHO "*** or is declared to -dlopen it."
5315 if test "$allow_undefined" = no
; then
5317 $ECHO "*** Since this library must not contain undefined symbols,"
5318 $ECHO "*** because either the platform does not support them or"
5319 $ECHO "*** it was explicitly requested with -no-undefined,"
5320 $ECHO "*** libtool will only create a static version of it."
5321 if test "$build_old_libs" = no
; then
5322 oldlibs
="$output_objdir/$libname.$libext"
5323 build_libtool_libs
=module
5326 build_libtool_libs
=no
5331 # Done checking deplibs!
5334 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
5337 newdeplibs
=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
5338 new_inherited_linker_flags
=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
5339 deplibs
=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
5343 # move library search paths that coincide with paths to not yet
5344 # installed libraries to the beginning of the library search list
5346 for path
in $notinst_path; do
5347 case " $new_libs " in
5348 *" -L$path/$objdir "*) ;;
5350 case " $deplibs " in
5351 *" -L$path/$objdir "*)
5352 new_libs
="$new_libs -L$path/$objdir" ;;
5357 for deplib
in $deplibs; do
5360 case " $new_libs " in
5362 *) new_libs
="$new_libs $deplib" ;;
5365 *) new_libs
="$new_libs $deplib" ;;
5370 # All the library-specific variables (install_libdir is set above).
5375 # Test again, we may have decided not to build it any more
5376 if test "$build_libtool_libs" = yes; then
5377 if test "$hardcode_into_libs" = yes; then
5378 # Hardcode the library paths
5381 rpath
="$finalize_rpath"
5382 test "$mode" != relink
&& rpath
="$compile_rpath$rpath"
5383 for libdir
in $rpath; do
5384 if test -n "$hardcode_libdir_flag_spec"; then
5385 if test -n "$hardcode_libdir_separator"; then
5386 if test -z "$hardcode_libdirs"; then
5387 hardcode_libdirs
="$libdir"
5389 # Just accumulate the unique libdirs.
5390 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
5391 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
5394 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
5399 eval flag
=\"$hardcode_libdir_flag_spec\"
5400 dep_rpath
="$dep_rpath $flag"
5402 elif test -n "$runpath_var"; then
5403 case "$perm_rpath " in
5405 *) perm_rpath
="$perm_rpath $libdir" ;;
5409 # Substitute the hardcoded libdirs into the rpath.
5410 if test -n "$hardcode_libdir_separator" &&
5411 test -n "$hardcode_libdirs"; then
5412 libdir
="$hardcode_libdirs"
5413 if test -n "$hardcode_libdir_flag_spec_ld"; then
5414 eval dep_rpath
=\"$hardcode_libdir_flag_spec_ld\"
5416 eval dep_rpath
=\"$hardcode_libdir_flag_spec\"
5419 if test -n "$runpath_var" && test -n "$perm_rpath"; then
5420 # We should set the runpath_var.
5422 for dir
in $perm_rpath; do
5425 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
5427 test -n "$dep_rpath" && deplibs
="$dep_rpath $deplibs"
5430 shlibpath
="$finalize_shlibpath"
5431 test "$mode" != relink
&& shlibpath
="$compile_shlibpath$shlibpath"
5432 if test -n "$shlibpath"; then
5433 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
5436 # Get the real and link names of the library.
5437 eval shared_ext
=\"$shrext_cmds\"
5438 eval library_names
=\"$library_names_spec\"
5439 set dummy
$library_names
5444 if test -n "$soname_spec"; then
5445 eval soname
=\"$soname_spec\"
5449 if test -z "$dlname"; then
5453 lib
="$output_objdir/$realname"
5457 linknames
="$linknames $link"
5460 # Use standard objects if they are pic
5461 test -z "$pic_flag" && libobjs
=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
5464 if test -n "$export_symbols" && test -n "$include_expsyms"; then
5465 $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
5466 export_symbols
="$output_objdir/$libname.uexp"
5467 delfiles
="$delfiles $export_symbols"
5470 orig_export_symbols
=
5473 if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
5474 # exporting using user supplied symfile
5475 if test "x`$SED 1q $export_symbols`" != xEXPORTS
; then
5476 # and it's NOT already a .def file. Must figure out
5477 # which of the given symbols are data symbols and tag
5478 # them as such. So, trigger use of export_symbols_cmds.
5479 # export_symbols gets reassigned inside the "prepare
5480 # the list of exported symbols" if statement, so the
5481 # include_expsyms logic still works.
5482 orig_export_symbols
="$export_symbols"
5484 always_export_symbols
=yes
5490 # Prepare the list of exported symbols
5491 if test -z "$export_symbols"; then
5492 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
5493 func_echo
"generating symbol list for \`$libname.la'"
5494 export_symbols
="$output_objdir/$libname.exp"
5495 $opt_dry_run || $RM $export_symbols
5496 cmds
=$export_symbols_cmds
5497 save_ifs
="$IFS"; IFS
='~'
5498 for cmd
in $cmds; do
5501 if len
=`expr "X$cmd" : ".*"` &&
5502 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5503 func_show_eval
"$cmd" 'exit $?'
5504 skipped_export
=false
5506 # The command line is too long to execute in one step.
5507 func_echo
"using reloadable object file for export list..."
5509 # Break out early, otherwise skipped_export may be
5510 # set to false by a later but shorter cmd.
5515 if test -n "$export_symbols_regex"; then
5516 func_show_eval
'$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
5517 func_show_eval
'$MV "${export_symbols}T" "$export_symbols"'
5522 if test -n "$export_symbols" && test -n "$include_expsyms"; then
5523 tmp_export_symbols
="$export_symbols"
5524 test -n "$orig_export_symbols" && tmp_export_symbols
="$orig_export_symbols"
5525 $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
5528 if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
5529 # The given exports_symbols file has to be filtered, so filter it.
5530 func_echo
"filter symbol list for \`$libname.la' to tag DATA exports"
5531 # FIXME: $output_objdir/$libname.filter potentially contains lots of
5532 # 's' commands which not all seds can handle. GNU sed should be fine
5533 # though. Also, the filter scales superlinearly with the number of
5534 # global variables. join(1) would be nice here, but unfortunately
5535 # isn't a blessed tool.
5536 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
5537 delfiles
="$delfiles $export_symbols $output_objdir/$libname.filter"
5538 export_symbols
=$output_objdir/$libname.def
5539 $opt_dry_run || $SED -f $output_objdir/$libname.filter
< $orig_export_symbols > $export_symbols
5543 for test_deplib
in $deplibs; do
5544 case " $convenience " in
5545 *" $test_deplib "*) ;;
5547 tmp_deplibs
="$tmp_deplibs $test_deplib"
5551 deplibs
="$tmp_deplibs"
5553 if test -n "$convenience"; then
5554 if test -n "$whole_archive_flag_spec"; then
5555 save_libobjs
=$libobjs
5556 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
5558 gentop
="$output_objdir/${outputname}x"
5559 generated
="$generated $gentop"
5561 func_extract_archives
$gentop $convenience
5562 libobjs
="$libobjs $func_extract_archives_result"
5566 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
5567 eval flag
=\"$thread_safe_flag_spec\"
5568 linker_flags
="$linker_flags $flag"
5571 # Make a backup of the uninstalled library when relinking
5572 if test "$mode" = relink
; then
5573 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
5576 # Do each of the archive commands.
5577 if test "$module" = yes && test -n "$module_cmds" ; then
5578 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
5579 eval test_cmds
=\"$module_expsym_cmds\"
5580 cmds
=$module_expsym_cmds
5582 eval test_cmds
=\"$module_cmds\"
5586 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
5587 eval test_cmds
=\"$archive_expsym_cmds\"
5588 cmds
=$archive_expsym_cmds
5590 eval test_cmds
=\"$archive_cmds\"
5595 if test "X$skipped_export" != "X:" &&
5596 len
=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
5597 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5600 # The command line is too long to link in one step, link piecewise
5601 # or, if using GNU ld and skipped_export is not :, use a linker
5604 # Save the value of $output and $libobjs because we want to
5605 # use them later. If we have whole_archive_flag_spec, we
5606 # want to use save_libobjs as it was before
5607 # whole_archive_flag_spec was expanded, because we can't
5608 # assume the linker understands whole_archive_flag_spec.
5609 # This may have to be revisited, in case too many
5610 # convenience libraries get linked in and end up exceeding
5612 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
5613 save_libobjs
=$libobjs
5616 output_la
=`$ECHO "X$output" | $Xsed -e "$basename"`
5618 # Clear the reloadable object creation command queue and
5619 # initialize k to one.
5626 if test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
5627 output
=${output_objdir}/${output_la}.lnkscript
5628 func_echo
"creating GNU ld script: $output"
5629 $ECHO 'INPUT (' > $output
5630 for obj
in $save_libobjs
5632 $ECHO \""$obj"\" >> $output
5634 $ECHO ')' >> $output
5635 delfiles
="$delfiles $output"
5636 elif test "X$skipped_export" != "X:" && test "X$file_list_spec" != X
; then
5637 output
=${output_objdir}/${output_la}.lnk
5638 func_echo
"creating linker input file list: $output"
5640 for obj
in $save_libobjs
5642 $ECHO "$obj" >> $output
5644 delfiles
="$delfiles $output"
5645 output
=\"$file_list_spec$output\"
5647 func_echo
"creating reloadable object files..."
5648 output
=$output_objdir/$output_la-${k}.
$objext
5649 # Loop over the list of objects to be linked.
5650 for obj
in $save_libobjs
5652 eval test_cmds
=\"$reload_cmds $objlist $last_robj\"
5653 if test "X$objlist" = X
||
5654 { len
=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
5655 test "$len" -le "$max_cmd_len"; }; then
5656 objlist
="$objlist $obj"
5658 # The command $test_cmds is almost too long, add a
5659 # command to the queue.
5660 if test "$k" -eq 1 ; then
5661 # The first file doesn't have a previous command to add.
5662 eval concat_cmds
=\"$reload_cmds $objlist $last_robj\"
5664 # All subsequent reloadable object files will link in
5665 # the last one created.
5666 eval concat_cmds
=\"\
$concat_cmds~
$reload_cmds $objlist $last_robj\"
5668 last_robj
=$output_objdir/$output_la-${k}.
$objext
5670 output
=$output_objdir/$output_la-${k}.
$objext
5675 # Handle the remaining objects by creating one last
5676 # reloadable object file. All subsequent reloadable object
5677 # files will link in the last one created.
5678 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
5679 eval concat_cmds
=\"\
${concat_cmds}$reload_cmds $objlist $last_robj\"
5681 if ${skipped_export-false}; then
5682 func_echo
"generating symbol list for \`$libname.la'"
5683 export_symbols
="$output_objdir/$libname.exp"
5684 $opt_dry_run || $RM $export_symbols
5686 # Append the command to create the export file.
5687 eval concat_cmds
=\"\
$concat_cmds~
$export_symbols_cmds\"
5690 # Set up a command to remove the reloadable object files
5691 # after they are used.
5693 while test "$i" -lt "$k"
5696 delfiles
="$delfiles $output_objdir/$output_la-${i}.$objext"
5699 func_echo
"creating a temporary reloadable object file: $output"
5701 # Loop through the commands generated above and execute them.
5702 save_ifs
="$IFS"; IFS
='~'
5703 for cmd
in $concat_cmds; do
5706 func_quote_for_expand
"$cmd"
5707 eval "func_echo $func_quote_for_expand_result"
5709 $opt_dry_run || eval "$cmd" || {
5712 # Restore the uninstalled library and exit
5713 if test "$mode" = relink
; then
5714 ( cd "$output_objdir" && \
5715 $RM "${realname}T" && \
5716 $MV "${realname}U" "$realname" )
5726 # Restore the value of output.
5729 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
5730 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
5732 # Expand the library linking commands again to reset the
5733 # value of $libobjs for piecewise linking.
5735 # Do each of the archive commands.
5736 if test "$module" = yes && test -n "$module_cmds" ; then
5737 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
5738 cmds
=$module_expsym_cmds
5743 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
5744 cmds
=$archive_expsym_cmds
5751 if test -n "$delfiles"; then
5752 # Append the command to remove temporary files to $cmds.
5753 eval cmds
=\"\
$cmds~\
$RM $delfiles\"
5756 # Add any objects from preloaded convenience libraries
5757 if test -n "$dlprefiles"; then
5758 gentop
="$output_objdir/${outputname}x"
5759 generated
="$generated $gentop"
5761 func_extract_archives
$gentop $dlprefiles
5762 libobjs
="$libobjs $func_extract_archives_result"
5765 save_ifs
="$IFS"; IFS
='~'
5766 for cmd
in $cmds; do
5770 func_quote_for_expand
"$cmd"
5771 eval "func_echo $func_quote_for_expand_result"
5773 $opt_dry_run || eval "$cmd" || {
5776 # Restore the uninstalled library and exit
5777 if test "$mode" = relink
; then
5778 ( cd "$output_objdir" && \
5779 $RM "${realname}T" && \
5780 $MV "${realname}U" "$realname" )
5788 # Restore the uninstalled library and exit
5789 if test "$mode" = relink
; then
5790 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
5792 if test -n "$convenience"; then
5793 if test -z "$whole_archive_flag_spec"; then
5794 func_show_eval
'${RM}r "$gentop"'
5801 # Create links to the real library.
5802 for linkname
in $linknames; do
5803 if test "$realname" != "$linkname"; then
5804 func_show_eval
'(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
5808 # If -module or -export-dynamic was specified, set the dlname.
5809 if test "$module" = yes || test "$export_dynamic" = yes; then
5810 # On all known operating systems, these are identical.
5817 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no
; then
5818 func_warning
"\`-dlopen' is ignored for objects"
5821 test -n "$deplibs" && \
5822 func_warning
"\`-l' and \`-L' are ignored for objects"
5824 test -n "$rpath" && \
5825 func_warning
"\`-rpath' is ignored for objects"
5827 test -n "$xrpath" && \
5828 func_warning
"\`-R' is ignored for objects"
5830 test -n "$vinfo" && \
5831 func_warning
"\`-version-info' is ignored for objects"
5833 test -n "$release" && \
5834 func_warning
"\`-release' is ignored for objects"
5838 test -n "$objs$old_deplibs" && \
5839 func_fatal_error
"cannot build library object \`$output' from non-libtool objects"
5842 obj
=`$ECHO "X$output" | $Xsed -e "$lo2o"`
5850 # Delete the old objects.
5851 $opt_dry_run || $RM $obj $libobj
5853 # Objects from convenience libraries. This assumes
5854 # single-version convenience libraries. Whenever we create
5855 # different ones for PIC/non-PIC, this we'll have to duplicate
5859 # reload_cmds runs $LD directly, so let us get rid of
5860 # -Wl from whole_archive_flag_spec
5863 if test -n "$convenience"; then
5864 if test -n "$whole_archive_flag_spec"; then
5865 eval reload_conv_objs
=\"\
$reload_objs $whole_archive_flag_spec\"
5867 gentop
="$output_objdir/${obj}x"
5868 generated
="$generated $gentop"
5870 func_extract_archives
$gentop $convenience
5871 reload_conv_objs
="$reload_objs $func_extract_archives_result"
5875 # Create the old-style object.
5876 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
5879 func_execute_cmds
"$reload_cmds" 'exit $?'
5881 # Exit if we aren't doing a library object file.
5882 if test -z "$libobj"; then
5883 if test -n "$gentop"; then
5884 func_show_eval
'${RM}r "$gentop"'
5890 if test "$build_libtool_libs" != yes; then
5891 if test -n "$gentop"; then
5892 func_show_eval
'${RM}r "$gentop"'
5895 # Create an invalid libtool object if no PIC, so that we don't
5896 # accidentally link it into a program.
5897 # $show "echo timestamp > $libobj"
5898 # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
5902 if test -n "$pic_flag" || test "$pic_mode" != default
; then
5903 # Only do commands if we really have different PIC objects.
5904 reload_objs
="$libobjs $reload_conv_objs"
5906 func_execute_cmds
"$reload_cmds" 'exit $?'
5909 if test -n "$gentop"; then
5910 func_show_eval
'${RM}r "$gentop"'
5918 *cygwin
*) func_stripname
'' '.exe' "$output"
5919 output
=$func_stripname_result.exe
;;
5921 test -n "$vinfo" && \
5922 func_warning
"\`-version-info' is ignored for programs"
5924 test -n "$release" && \
5925 func_warning
"\`-release' is ignored for programs"
5927 test "$preload" = yes \
5928 && test "$dlopen_support" = unknown \
5929 && test "$dlopen_self" = unknown \
5930 && test "$dlopen_self_static" = unknown
&& \
5931 func_warning
"\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
5934 *-*-rhapsody* | *-*-darwin1.
[012])
5935 # On Rhapsody replace the C library is the System framework
5936 compile_deplibs
=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
5937 finalize_deplibs
=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
5943 # Don't allow lazy linking, it breaks C++ global constructors
5944 # But is supposedly fixed on 10.4 or later (yay!).
5945 if test "$tagname" = CXX
; then
5946 case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
5948 compile_command
="$compile_command ${wl}-bind_at_load"
5949 finalize_command
="$finalize_command ${wl}-bind_at_load"
5953 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
5954 compile_deplibs
=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
5955 finalize_deplibs
=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
5960 # move library search paths that coincide with paths to not yet
5961 # installed libraries to the beginning of the library search list
5963 for path
in $notinst_path; do
5964 case " $new_libs " in
5965 *" -L$path/$objdir "*) ;;
5967 case " $compile_deplibs " in
5968 *" -L$path/$objdir "*)
5969 new_libs
="$new_libs -L$path/$objdir" ;;
5974 for deplib
in $compile_deplibs; do
5977 case " $new_libs " in
5979 *) new_libs
="$new_libs $deplib" ;;
5982 *) new_libs
="$new_libs $deplib" ;;
5985 compile_deplibs
="$new_libs"
5988 compile_command
="$compile_command $compile_deplibs"
5989 finalize_command
="$finalize_command $finalize_deplibs"
5991 if test -n "$rpath$xrpath"; then
5992 # If the user specified any rpath flags, then add them.
5993 for libdir
in $rpath $xrpath; do
5994 # This is the magic to use -rpath.
5995 case "$finalize_rpath " in
5997 *) finalize_rpath
="$finalize_rpath $libdir" ;;
6002 # Now hardcode the library paths
6005 for libdir
in $compile_rpath $finalize_rpath; do
6006 if test -n "$hardcode_libdir_flag_spec"; then
6007 if test -n "$hardcode_libdir_separator"; then
6008 if test -z "$hardcode_libdirs"; then
6009 hardcode_libdirs
="$libdir"
6011 # Just accumulate the unique libdirs.
6012 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
6013 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
6016 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
6021 eval flag
=\"$hardcode_libdir_flag_spec\"
6022 rpath
="$rpath $flag"
6024 elif test -n "$runpath_var"; then
6025 case "$perm_rpath " in
6027 *) perm_rpath
="$perm_rpath $libdir" ;;
6031 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
6032 testbindir
=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
6033 case :$dllsearchpath: in
6035 *) dllsearchpath
="$dllsearchpath:$libdir";;
6037 case :$dllsearchpath: in
6038 *":$testbindir:"*) ;;
6039 *) dllsearchpath
="$dllsearchpath:$testbindir";;
6044 # Substitute the hardcoded libdirs into the rpath.
6045 if test -n "$hardcode_libdir_separator" &&
6046 test -n "$hardcode_libdirs"; then
6047 libdir
="$hardcode_libdirs"
6048 eval rpath
=\" $hardcode_libdir_flag_spec\"
6050 compile_rpath
="$rpath"
6054 for libdir
in $finalize_rpath; do
6055 if test -n "$hardcode_libdir_flag_spec"; then
6056 if test -n "$hardcode_libdir_separator"; then
6057 if test -z "$hardcode_libdirs"; then
6058 hardcode_libdirs
="$libdir"
6060 # Just accumulate the unique libdirs.
6061 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
6062 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
6065 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
6070 eval flag
=\"$hardcode_libdir_flag_spec\"
6071 rpath
="$rpath $flag"
6073 elif test -n "$runpath_var"; then
6074 case "$finalize_perm_rpath " in
6076 *) finalize_perm_rpath
="$finalize_perm_rpath $libdir" ;;
6080 # Substitute the hardcoded libdirs into the rpath.
6081 if test -n "$hardcode_libdir_separator" &&
6082 test -n "$hardcode_libdirs"; then
6083 libdir
="$hardcode_libdirs"
6084 eval rpath
=\" $hardcode_libdir_flag_spec\"
6086 finalize_rpath
="$rpath"
6088 if test -n "$libobjs" && test "$build_old_libs" = yes; then
6089 # Transform all the library objects into standard objects.
6090 compile_command
=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
6091 finalize_command
=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
6094 func_generate_dlsyms
"$outputname" "@PROGRAM@" "no"
6096 # template prelinking step
6097 if test -n "$prelink_cmds"; then
6098 func_execute_cmds
"$prelink_cmds" 'exit $?'
6101 wrappers_required
=yes
6103 *cygwin
* | *mingw
* )
6104 if test "$build_libtool_libs" != yes; then
6105 wrappers_required
=no
6109 if test "$need_relink" = no
|| test "$build_libtool_libs" != yes; then
6110 wrappers_required
=no
6114 if test "$wrappers_required" = no
; then
6115 # Replace the output file specification.
6116 compile_command
=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
6117 link_command
="$compile_command$compile_rpath"
6119 # We have no uninstalled library dependencies, so finalize right now.
6121 func_show_eval
"$link_command" 'exit_status=$?'
6123 # Delete the generated files.
6124 if test -f "$output_objdir/${outputname}S.${objext}"; then
6125 func_show_eval
'$RM "$output_objdir/${outputname}S.${objext}"'
6131 if test -n "$compile_shlibpath$finalize_shlibpath"; then
6132 compile_command
="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
6134 if test -n "$finalize_shlibpath"; then
6135 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
6140 if test -n "$runpath_var"; then
6141 if test -n "$perm_rpath"; then
6142 # We should set the runpath_var.
6144 for dir
in $perm_rpath; do
6147 compile_var
="$runpath_var=\"$rpath\$$runpath_var\" "
6149 if test -n "$finalize_perm_rpath"; then
6150 # We should set the runpath_var.
6152 for dir
in $finalize_perm_rpath; do
6155 finalize_var
="$runpath_var=\"$rpath\$$runpath_var\" "
6159 if test "$no_install" = yes; then
6160 # We don't need to create a wrapper script.
6161 link_command
="$compile_var$compile_command$compile_rpath"
6162 # Replace the output file specification.
6163 link_command
=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
6164 # Delete the old output file.
6165 $opt_dry_run || $RM $output
6166 # Link the executable and exit
6167 func_show_eval
"$link_command" 'exit $?'
6171 if test "$hardcode_action" = relink
; then
6172 # Fast installation is not supported
6173 link_command
="$compile_var$compile_command$compile_rpath"
6174 relink_command
="$finalize_var$finalize_command$finalize_rpath"
6176 func_warning
"this platform does not like uninstalled shared libraries"
6177 func_warning
"\`$output' will be relinked during installation"
6179 if test "$fast_install" != no
; then
6180 link_command
="$finalize_var$compile_command$finalize_rpath"
6181 if test "$fast_install" = yes; then
6182 relink_command
=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
6184 # fast_install is set to needless
6188 link_command
="$compile_var$compile_command$compile_rpath"
6189 relink_command
="$finalize_var$finalize_command$finalize_rpath"
6193 # Replace the output file specification.
6194 link_command
=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
6196 # Delete the old output files.
6197 $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt
-$outputname
6199 func_show_eval
"$link_command" 'exit $?'
6201 # Now create the wrapper script.
6202 func_echo
"creating $output"
6204 # Quote the relink command for shipping.
6205 if test -n "$relink_command"; then
6206 # Preserve any variables that may affect compiler behavior
6207 for var
in $variables_saved_for_relink; do
6208 if eval test -z \"\
${$var+set}\"; then
6209 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
6210 elif eval var_value
=\$
$var; test -z "$var_value"; then
6211 relink_command
="$var=; export $var; $relink_command"
6213 func_quote_for_eval
"$var_value"
6214 relink_command
="$var=$func_quote_for_eval_result; export $var; $relink_command"
6217 relink_command
="(cd `pwd`; $relink_command)"
6218 relink_command
=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
6221 # Quote $ECHO for shipping.
6222 if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
6224 [\\/]* | [A
-Za-z]:[\\/]*) qecho
="$SHELL $progpath --fallback-echo";;
6225 *) qecho
="$SHELL `pwd`/$progpath --fallback-echo";;
6227 qecho
=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
6229 qecho
=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
6232 # Only actually do things if not in dry run mode.
6234 # win32 will think the script is a binary if it has
6235 # a .exe suffix, so we strip it off here.
6237 *.exe
) func_stripname
'' '.exe' "$output"
6238 output
=$func_stripname_result ;;
6240 # test for cygwin because mv fails w/o .exe extensions
6244 func_stripname
'' '.exe' "$outputname"
6245 outputname
=$func_stripname_result ;;
6249 *cygwin
* | *mingw
* )
6250 output_name
=`basename $output`
6251 output_path
=`dirname $output`
6252 cwrappersource
="$output_path/$objdir/lt-$output_name.c"
6253 cwrapper
="$output_path/$output_name.exe"
6254 $RM $cwrappersource $cwrapper
6255 trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
6257 cat > $cwrappersource <<EOF
6259 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
6260 Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
6262 The $output program cannot be directly executed until all the libtool
6263 libraries that it depends on are installed.
6265 This wrapper executable should never be moved out of the build directory.
6266 If it is, it will not operate correctly.
6268 Currently, it simply execs the wrapper *script* "/bin/sh $output",
6269 but could eventually absorb all of the scripts functionality and
6270 exec $objdir/$outputname directly.
6273 cat >> $cwrappersource<<"EOF"
6282 #include <sys/stat.h>
6284 #if defined(PATH_MAX)
6285 # define LT_PATHMAX PATH_MAX
6286 #elif defined(MAXPATHLEN)
6287 # define LT_PATHMAX MAXPATHLEN
6289 # define LT_PATHMAX 1024
6292 #ifndef DIR_SEPARATOR
6293 # define DIR_SEPARATOR '/'
6294 # define PATH_SEPARATOR ':'
6297 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
6299 # define HAVE_DOS_BASED_FILE_SYSTEM
6300 # ifndef DIR_SEPARATOR_2
6301 # define DIR_SEPARATOR_2 '\\'
6303 # ifndef PATH_SEPARATOR_2
6304 # define PATH_SEPARATOR_2 ';'
6308 #ifndef DIR_SEPARATOR_2
6309 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
6310 #else /* DIR_SEPARATOR_2 */
6311 # define IS_DIR_SEPARATOR(ch) \
6312 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
6313 #endif /* DIR_SEPARATOR_2 */
6315 #ifndef PATH_SEPARATOR_2
6316 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
6317 #else /* PATH_SEPARATOR_2 */
6318 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
6319 #endif /* PATH_SEPARATOR_2 */
6321 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
6322 #define XFREE(stale) do { \
6323 if (stale) { free ((void *) stale); stale = 0; } \
6326 /* -DDEBUG is fairly common in CFLAGS. */
6328 #if defined DEBUGWRAPPER
6329 # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
6331 # define DEBUG(format, ...)
6334 const char *program_name = NULL;
6336 void * xmalloc (size_t num);
6337 char * xstrdup (const char *string);
6338 const char * base_name (const char *name);
6339 char * find_executable(const char *wrapper);
6340 int check_executable(const char *path);
6341 char * strendzap(char *str, const char *pat);
6342 void lt_fatal (const char *message, ...);
6345 main (int argc, char *argv[])
6350 program_name = (char *) xstrdup (base_name (argv[0]));
6351 DEBUG("(main) argv[0] : %s\n",argv[0]);
6352 DEBUG("(main) program_name : %s\n",program_name);
6353 newargz = XMALLOC(char *, argc+2);
6356 cat >> $cwrappersource <<EOF
6357 newargz[0] = (char *) xstrdup("$SHELL");
6360 cat >> $cwrappersource <<"EOF"
6361 newargz
[1] = find_executable
(argv
[0]);
6362 if (newargz
[1] == NULL
)
6363 lt_fatal
("Couldn't find %s", argv
[0]);
6364 DEBUG
("(main) found exe at : %s\n",newargz
[1]);
6365 /* we know the
script has the same name
, without the .exe
*/
6366 /* so
make sure newargz
[1] doesn
't end in .exe */
6367 strendzap(newargz[1],".exe");
6368 for (i = 1; i < argc; i++)
6369 newargz[i+1] = xstrdup(argv[i]);
6370 newargz[argc+1] = NULL;
6372 for (i=0; i<argc+1; i++)
6374 DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
6382 cat >> $cwrappersource <<EOF
6383 execv("$SHELL",(char const **)newargz);
6387 cat >> $cwrappersource <<EOF
6388 execv("$SHELL",newargz);
6393 cat >> $cwrappersource <<"EOF"
6398 xmalloc (size_t num)
6400 void * p = (void *) malloc (num);
6402 lt_fatal ("Memory exhausted");
6408 xstrdup (const char *string)
6410 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
6415 base_name (const char *name)
6419 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
6420 /* Skip over the disk name in MSDOS pathnames. */
6421 if (isalpha ((unsigned char)name[0]) && name[1] == ':')
6425 for (base = name; *name; name++)
6426 if (IS_DIR_SEPARATOR (*name))
6432 check_executable(const char * path)
6436 DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
6437 if ((!path) || (!*path))
6440 if ((stat (path, &st) >= 0) &&
6442 /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
6443 #if defined (S_IXOTH)
6444 ((st.st_mode & S_IXOTH) == S_IXOTH) ||
6446 #if defined (S_IXGRP)
6447 ((st.st_mode & S_IXGRP) == S_IXGRP) ||
6449 ((st.st_mode & S_IXUSR) == S_IXUSR))
6456 /* Searches for the full path of the wrapper. Returns
6457 newly allocated full path name if found, NULL otherwise */
6459 find_executable (const char* wrapper)
6464 /* static buffer for getcwd */
6465 char tmp[LT_PATHMAX + 1];
6469 DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
6471 if ((wrapper == NULL) || (*wrapper == '\
0'))
6474 /* Absolute path? */
6475 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
6476 if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
6478 concat_name = xstrdup (wrapper);
6479 if (check_executable(concat_name))
6486 if (IS_DIR_SEPARATOR (wrapper[0]))
6488 concat_name = xstrdup (wrapper);
6489 if (check_executable(concat_name))
6493 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
6497 for (p = wrapper; *p; p++)
6505 /* no slashes; search PATH */
6506 const char* path = getenv ("PATH");
6509 for (p = path; *p; p = p_next)
6513 for (q = p; *q; q++)
6514 if (IS_PATH_SEPARATOR(*q))
6517 p_next = (*q == '\
0' ? q : q + 1);
6520 /* empty path: current directory */
6521 if (getcwd (tmp, LT_PATHMAX) == NULL)
6522 lt_fatal ("getcwd failed");
6523 tmp_len = strlen(tmp);
6524 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
6525 memcpy (concat_name, tmp, tmp_len);
6526 concat_name[tmp_len] = '/';
6527 strcpy (concat_name + tmp_len + 1, wrapper);
6531 concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
6532 memcpy (concat_name, p, p_len);
6533 concat_name[p_len] = '/';
6534 strcpy (concat_name + p_len + 1, wrapper);
6536 if (check_executable(concat_name))
6541 /* not found in PATH; assume curdir */
6543 /* Relative path | not found in path: prepend cwd */
6544 if (getcwd (tmp, LT_PATHMAX) == NULL)
6545 lt_fatal ("getcwd failed");
6546 tmp_len = strlen(tmp);
6547 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
6548 memcpy (concat_name, tmp, tmp_len);
6549 concat_name[tmp_len] = '/';
6550 strcpy (concat_name + tmp_len + 1, wrapper);
6552 if (check_executable(concat_name))
6559 strendzap(char *str, const char *pat)
6563 assert(str != NULL);
6564 assert(pat != NULL);
6567 patlen = strlen(pat);
6571 str += len - patlen;
6572 if (strcmp(str, pat) == 0)
6579 lt_error_core (int exit_status, const char * mode,
6580 const char * message, va_list ap)
6582 fprintf (stderr, "%s: %s: ", program_name, mode);
6583 vfprintf (stderr, message, ap);
6584 fprintf (stderr, ".\n");
6586 if (exit_status >= 0)
6591 lt_fatal (const char *message, ...)
6594 va_start (ap, message);
6595 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
6599 # we should really use a build-platform specific compiler
6600 # here, but OTOH, the wrappers (shell script and this C one)
6601 # are only useful if you want to execute the "real" binary.
6602 # Since the "real" binary is built for $host, then this
6603 # wrapper might as well be built for $host, too.
6604 $opt_dry_run || $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
6608 trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
6613 # $output - temporary wrapper script for $objdir/$outputname
6614 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
6616 # The $output program cannot be directly executed until all the libtool
6617 # libraries that it depends on are installed.
6619 # This wrapper script should never be moved out of the build directory.
6620 # If it is, it will not operate correctly.
6622 # Sed substitution that helps us do robust quoting. It backslashifies
6623 # metacharacters that are still active within double-quoted strings.
6624 Xsed='${SED} -e 1s
/^X
//'
6625 sed_quote_subst='$sed_quote_subst'
6627 # The HP-UX ksh and POSIX shell print the target directory to stdout
6629 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
6631 relink_command=\"$relink_command\"
6633 # This environment variable determines our operation mode.
6634 if test \"\$libtool_install_magic\" = \"$magic\"; then
6635 # install mode needs the following variables:
6636 generated_by_libtool_version='$macro_version'
6637 notinst_deplibs='$notinst_deplibs'
6639 # When we are sourced in execute mode, \$file and \$ECHO are already set.
6640 if test \"\$libtool_execute_magic\" != \"$magic\"; then
6643 # Make sure echo works.
6644 if test \"X\$1\" = X--no-reexec; then
6645 # Discard the --no-reexec flag, and continue.
6647 elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X
\t'; then
6648 # Yippee, \$ECHO works!
6651 # Restart under the correct shell, and then maybe \$ECHO will work.
6652 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
6658 # Find the directory that this script lives in.
6659 thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's
%/[^
/]*$
%%'\`
6660 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
6662 # Follow symbolic links until we get to the real thisdir.
6663 file=\`ls -ld \"\$file\" | ${SED} -n 's
/.
*-> //p
'\`
6664 while test -n \"\$file\"; do
6665 destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's
%/[^
/]*\$
%%'\`
6667 # If there was a directory component, then change thisdir.
6668 if test \"x\$destdir\" != \"x\$file\"; then
6669 case \"\$destdir\" in
6670 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
6671 *) thisdir=\"\$thisdir/\$destdir\" ;;
6675 file=\`\$ECHO \"X\$file\" | \$Xsed -e 's
%^.
*/%%'\`
6676 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's
/.
*-> //p
'\`
6679 # Try to get the absolute directory name.
6680 absdir=\`cd \"\$thisdir\" && pwd\`
6681 test -n \"\$absdir\" && thisdir=\"\$absdir\"
6684 if test "$fast_install" = yes; then
6686 program=lt-'$outputname'$exeext
6687 progdir=\"\$thisdir/$objdir\"
6689 if test ! -f \"\$progdir/\$program\" ||
6690 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
6691 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
6693 file=\"\$\$-\$program\"
6695 if test ! -d \"\$progdir\"; then
6696 $MKDIR \"\$progdir\"
6698 $RM \"\$progdir/\$file\"
6703 # relink executable if necessary
6704 if test -n \"\$relink_command\"; then
6705 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
6707 $ECHO \"\$relink_command_output\" >&2
6708 $RM \"\$progdir/\$file\"
6713 $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
6714 { $RM \"\$progdir/\$program\";
6715 $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
6716 $RM \"\$progdir/\$file\"
6720 program='$outputname'
6721 progdir=\"\$thisdir/$objdir\"
6727 if test -f \"\$progdir/\$program\"; then"
6729 # Export our shlibpath_var if we have one.
6730 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
6732 # Add our own library path to $shlibpath_var
6733 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
6735 # Some systems cannot cope with colon-terminated $shlibpath_var
6736 # The second colon is a workaround for a bug in BeOS R4 sed
6737 $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's
/::*\$
//'\`
6739 export $shlibpath_var
6743 # fixup the dll searchpath if we need to.
6744 if test -n "$dllsearchpath"; then
6746 # Add the dll search path components to the executable PATH
6747 PATH=$dllsearchpath:\$PATH
6752 if test \"\$libtool_execute_magic\" != \"$magic\"; then
6753 # Run the actual program with our arguments.
6756 # Backslashes separate directories on plain windows
6757 *-*-mingw | *-*-os2*)
6759 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
6765 exec \"\$progdir/\$program\" \${1+\"\$@\"}
6770 \$ECHO \"\$0: cannot exec \$program \${1+\"\$@\"}\"
6774 # The program doesn't exist.
6775 \
$ECHO \"\
$0: error
: \\\
`\$progdir/\$program' does not exist\" 1>&2
6776 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
6777 $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
6788 # See if we need to build an old-fashioned archive.
6789 for oldlib in $oldlibs; do
6791 if test "$build_libtool_libs" = convenience; then
6792 oldobjs="$libobjs_save $symfileobj"
6793 addlibs="$convenience"
6794 build_libtool_libs=no
6796 if test "$build_libtool_libs" = module; then
6797 oldobjs="$libobjs_save"
6798 build_libtool_libs=no
6800 oldobjs="$old_deplibs $non_pic_objects"
6801 if test "$preload" = yes && test -f "$symfileobj"; then
6802 oldobjs="$oldobjs $symfileobj"
6805 addlibs="$old_convenience"
6808 if test -n "$addlibs"; then
6809 gentop="$output_objdir/${outputname}x"
6810 generated="$generated $gentop"
6812 func_extract_archives $gentop $addlibs
6813 oldobjs="$oldobjs $func_extract_archives_result"
6816 # Do each command in the archive commands.
6817 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
6818 cmds=$old_archive_from_new_cmds
6821 # Add any objects from preloaded convenience libraries
6822 if test -n "$dlprefiles"; then
6823 gentop="$output_objdir/${outputname}x"
6824 generated="$generated $gentop"
6826 func_extract_archives $gentop $dlprefiles
6827 oldobjs="$oldobjs $func_extract_archives_result"
6830 # POSIX demands no paths to be encoded in archives. We have
6831 # to avoid creating archives with duplicate basenames if we
6832 # might have to extract them afterwards, e.g., when creating a
6833 # static archive out of a convenience library, or when linking
6834 # the entirety of a libtool archive into another (currently
6835 # not supported by libtool).
6836 if (for obj in $oldobjs
6838 func_basename "$obj"
6839 $ECHO "$func_basename_result"
6840 done | sort | sort -uc >/dev/null 2>&1); then
6843 $ECHO "copying selected object files to avoid basename conflicts..."
6844 gentop="$output_objdir/${outputname}x"
6845 generated="$generated $gentop"
6846 func_mkdir_p "$gentop"
6847 save_oldobjs=$oldobjs
6850 for obj in $save_oldobjs
6852 func_basename "$obj"
6853 objbase="$func_basename_result"
6854 case " $oldobjs " in
6855 " ") oldobjs=$obj ;;
6858 # Make sure we don't pick an alternate name that also
6860 newobj=lt$counter-$objbase
6861 counter=`expr $counter + 1`
6862 case " $oldobjs " in
6863 *[\ /]"$newobj "*) ;;
6864 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
6867 func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
6868 oldobjs="$oldobjs $gentop/$newobj"
6870 *) oldobjs="$oldobjs $obj" ;;
6874 eval cmds=\"$old_archive_cmds\"
6876 if len=`expr "X$cmds" : ".*" 2>/dev
/null
` &&
6877 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
6878 cmds=$old_archive_cmds
6880 # the command line is too long to link in one step, link in parts
6881 func_echo "using piecewise archive linking..."
6886 save_oldobjs=$oldobjs
6887 # Is there a better way of finding the last object in the list?
6888 for obj in $save_oldobjs
6892 for obj in $save_oldobjs
6894 oldobjs="$objlist $obj"
6895 objlist="$objlist $obj"
6896 eval test_cmds=\"$old_archive_cmds\"
6897 if len=`expr "X$test_cmds" : ".*" 2>/dev
/null
` &&
6898 test "$len" -le "$max_cmd_len"; then
6901 # the above command should be used before it gets too long
6903 if test "$obj" = "$last_oldobj" ; then
6906 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
6907 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
6913 if test "X$oldobjs" = "X" ; then
6914 eval cmds=\"\$concat_cmds\"
6916 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
6920 func_execute_cmds "$cmds" 'exit $?'
6923 test -n "$generated" && \
6924 func_show_eval "${RM}r$generated"
6926 # Now create the libtool archive.
6930 test "$build_old_libs" = yes && old_library="$libname.$libext"
6931 func_echo "creating $output"
6933 # Preserve any variables that may affect compiler behavior
6934 for var in $variables_saved_for_relink; do
6935 if eval test -z \"\${$var+set}\"; then
6936 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
6937 elif eval var_value=\$$var; test -z "$var_value"; then
6938 relink_command="$var=; export $var; $relink_command"
6940 func_quote_for_eval "$var_value"
6941 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
6944 # Quote the link command for shipping.
6945 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
6946 relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
6947 if test "$hardcode_automatic" = yes ; then
6951 # Only create the output if not a dry run.
6953 for installed in no yes; do
6954 if test "$installed" = yes; then
6955 if test -z "$install_libdir"; then
6958 output="$output_objdir/$outputname"i
6959 # Replace all uninstalled libtool libraries with the installed ones
6961 for deplib in $dependency_libs; do
6964 func_basename "$deplib"
6965 name="$func_basename_result"
6966 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
6967 test -z "$libdir" && \
6968 func_fatal_error "\`$deplib' is not a valid libtool archive"
6969 newdependency_libs="$newdependency_libs $libdir/$name"
6971 *) newdependency_libs="$newdependency_libs $deplib" ;;
6974 dependency_libs="$newdependency_libs"
6977 for lib in $dlfiles; do
6980 func_basename "$lib"
6981 name="$func_basename_result"
6982 eval libdir=`${SED} -n -e 's
/^libdir
=\
(.
*\
)$
/\
1/p
' $lib`
6983 test -z "$libdir" && \
6984 func_fatal_error "\`$lib' is not a valid libtool archive
"
6985 newdlfiles="$newdlfiles $libdir/$name"
6987 *) newdlfiles="$newdlfiles $lib" ;;
6990 dlfiles="$newdlfiles"
6992 for lib in $dlprefiles; do
6995 # Only pass preopened files to the pseudo-archive (for
6996 # eventual linking with the app. that links it) if we
6997 # didn't already link the preopened objects directly into
6999 func_basename "$lib"
7000 name="$func_basename_result"
7001 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
7002 test -z "$libdir" && \
7003 func_fatal_error "\
`$lib' is not a valid libtool archive"
7004 newdlprefiles="$newdlprefiles $libdir/$name"
7008 dlprefiles="$newdlprefiles"
7011 for lib in $dlfiles; do
7013 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
7014 *) abs=`pwd`"/$lib" ;;
7016 newdlfiles="$newdlfiles $abs"
7018 dlfiles="$newdlfiles"
7020 for lib in $dlprefiles; do
7022 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
7023 *) abs=`pwd`"/$lib" ;;
7025 newdlprefiles="$newdlprefiles $abs"
7027 dlprefiles="$newdlprefiles"
7030 # place dlname in correct position for cygwin
7032 case $host,$output,$installed,$module,$dlname in
7033 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
7036 # $outputname - a libtool library file
7037 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
7039 # Please DO NOT delete this file!
7040 # It is necessary for linking the library.
7042 # The name that we can dlopen(3).
7045 # Names of this library.
7046 library_names='$library_names'
7048 # The name of the static archive.
7049 old_library='$old_library'
7051 # Linker flags that can not go in dependency_libs.
7052 inherited_linker_flags='$new_inherited_linker_flags'
7054 # Libraries that this one depends upon.
7055 dependency_libs='$dependency_libs'
7057 # Names of additional weak libraries provided by this library
7058 weak_library_names='$weak_libs'
7060 # Version information for $libname.
7065 # Is this an already installed library?
7066 installed=$installed
7068 # Should we warn about portability when linking against -modules?
7069 shouldnotlink=$module
7071 # Files to dlopen/dlpreopen
7073 dlpreopen='$dlprefiles'
7075 # Directory that this library needs to be installed in:
7076 libdir='$install_libdir'"
7077 if test "$installed" = no && test "$need_relink" = yes; then
7079 relink_command=\"$relink_command\""
7084 # Do a symbolic link so that the libtool archive can be found in
7085 # LD_LIBRARY_PATH before the program is installed.
7086 func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
7093 # func_mode_uninstall arg...
7094 func_mode_uninstall ()
7102 # This variable tells wrapper scripts just to set variables rather
7103 # than running their programs.
7104 libtool_install_magic="$magic"
7109 -f) RM="$RM $arg"; rmforce=yes ;;
7110 -*) RM="$RM $arg" ;;
7111 *) files="$files $arg" ;;
7116 func_fatal_help "you must specify an RM program"
7120 origobjdir="$objdir"
7121 for file in $files; do
7122 func_dirname "$file" "" "."
7123 dir="$func_dirname_result"
7124 if test "X$dir" = X.; then
7125 objdir="$origobjdir"
7127 objdir="$dir/$origobjdir"
7129 func_basename "$file"
7130 name="$func_basename_result"
7131 test "$mode" = uninstall && objdir="$dir"
7133 # Remember objdir for removal later, being careful to avoid duplicates
7134 if test "$mode" = clean; then
7137 *) rmdirs="$rmdirs $objdir" ;;
7141 # Don't error if the file doesn't exist and rm -f was used.
7142 if { test -L "$file"; } >/dev/null 2>&1 ||
7143 { test -h "$file"; } >/dev/null 2>&1 ||
7144 test -f "$file"; then
7146 elif test -d "$file"; then
7149 elif test "$rmforce" = yes; then
7157 # Possibly a libtool archive, so verify it.
7158 if func_lalib_p "$file"; then
7161 # Delete the libtool libraries and symlinks.
7162 for n in $library_names; do
7163 rmfiles="$rmfiles $objdir/$n"
7165 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
7169 case " $library_names " in
7170 # " " in the beginning catches empty $dlname
7172 *) rmfiles="$rmfiles $objdir/$dlname" ;;
7174 test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
7177 if test -n "$library_names"; then
7178 # Do each command in the postuninstall commands.
7179 func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
7182 if test -n "$old_library"; then
7183 # Do each command in the old_postuninstall commands.
7184 func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
7186 # FIXME: should reinstall the best remaining shared library.
7193 # Possibly a libtool object, so verify it.
7194 if func_lalib_p "$file"; then
7199 # Add PIC object to the list of files to remove.
7200 if test -n "$pic_object" &&
7201 test "$pic_object" != none; then
7202 rmfiles="$rmfiles $dir/$pic_object"
7205 # Add non-PIC object to the list of files to remove.
7206 if test -n "$non_pic_object" &&
7207 test "$non_pic_object" != none; then
7208 rmfiles="$rmfiles $dir/$non_pic_object"
7214 if test "$mode" = clean ; then
7218 func_stripname '' '.exe' "$file"
7219 file=$func_stripname_result
7220 func_stripname '' '.exe' "$name"
7221 noexename=$func_stripname_result
7222 # $file with .exe has already been added to rmfiles,
7223 # add $file without .exe
7224 rmfiles="$rmfiles $file"
7227 # Do a test to see if this is a libtool program.
7228 if func_ltwrapper_p "$file"; then
7232 # note $name still contains .exe if it was in $file originally
7233 # as does the version of $file that was added into $rmfiles
7234 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
7235 if test "$fast_install" = yes && test -n "$relink_command"; then
7236 rmfiles="$rmfiles $objdir/lt-$name"
7238 if test "X$noexename" != "X$name" ; then
7239 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
7245 func_show_eval "$RM $rmfiles" 'exit_status=1'
7247 objdir="$origobjdir"
7249 # Try to remove the ${objdir}s in the directories where we deleted files
7250 for dir in $rmdirs; do
7251 if test -d "$dir"; then
7252 func_show_eval "rmdir $dir >/dev/null 2>&1"
7260 # TEST SUITE MARKER ## NON-FUNCTION
7266 # Sanity checks first:
7267 func_check_version_match
7269 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
7270 func_fatal_configuration "not configured to build any kind of library"
7273 test -z "$mode" && func_fatal_error "error: you must specify a MODE."
7277 eval std_shrext=\"$shrext_cmds\"
7280 # Only execute mode is allowed to have -dlopen flags.
7281 if test -n "$execute_dlfiles" && test "$mode" != execute; then
7282 func_error "unrecognized option \`-dlopen'"
7287 # Change the help message to a mode-specific one.
7288 generic_help="$help"
7289 help="Try \`$progname --help --mode=$mode' for more information.
"
7292 compile) func_mode_compile ${1+"$@"} ;;
7293 execute) func_mode_execute ${1+"$@"} ;;
7294 finish) func_mode_finish ${1+"$@"} ;;
7295 install) func_mode_install ${1+"$@"} ;;
7296 link|relink) func_mode_link ${1+"$@"} ;;
7297 uninstall|clean) func_mode_uninstall ${1+"$@"} ;;
7299 "") help="$generic_help"
7300 func_fatal_help "you must specify a MODE
"
7304 test -z "$exec_cmd" && \
7305 func_fatal_help "invalid operation mode \
`$mode'"
7307 if test -n "$exec_cmd"; then
7308 eval exec "$exec_cmd"
7316 # The TAGs below are defined such that we never get into a situation
7317 # in which we disable both kinds of libraries. Given conflicting
7318 # choices, we go for a static library, that is the most portable,
7319 # since we can't tell whether shared libraries were disabled because
7320 # the user asked for that or because the platform doesn't support
7321 # them. This is particularly important on AIX, because we don't
7322 # support having both static and shared libraries enabled at the same
7323 # time on that platform, so we default to a shared-only configuration.
7324 # If a disable-shared tag is given, we'll fallback to a static-only
7325 # configuration. But we'll never go from static-only to shared-only.
7327 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
7328 build_libtool_libs=no
7330 # ### END LIBTOOL TAG CONFIG: disable-shared
7332 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
7333 build_old_libs=`case $build_libtool_libs in yes) echo no
;; *) echo yes;; esac`
7334 # ### END LIBTOOL TAG CONFIG: disable-static