1 # Generated from ltmain.m4sh; do not edit by hand
3 # ltmain.sh (GNU libtool 1.2317 2006/08/07 16:25:08) 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:
65 # compiler flags: $LTCFLAGS
66 # linker: $LD (gnu? $with_gnu_ld)
67 # $progname: (GNU libtool 1.2317 2006/08/07 16:25:08) 2.1a
68 # automake: $automake_version
69 # autoconf: $autoconf_version
71 # Report bugs to <bug-libtool@gnu.org>.
76 TIMESTAMP
=" 1.2317 2006/08/07 16:25:08"
77 package_revision
=1.2317
79 # Be Bourne compatible
80 if test -n "${ZSH_VERSION+set}" && (emulate sh
) >/dev
/null
2>&1; then
83 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
84 # is contrary to our usage. Disable this feature.
85 alias -g '${1+"$@"}'='"$@"'
88 case `(set -o) 2>/dev/null` in *posix
*) set -o posix
;; esac
90 BIN_SH
=xpg4
; export BIN_SH
# for Tru64
91 DUALCASE
=1; export DUALCASE
# for MKS sh
93 # NLS nuisances: We save the old values to restore during execute mode.
94 # Only set LANG and LC_ALL to C if already set.
95 # These must not be set unconditionally because not all systems understand
96 # e.g. LANG=C (notably SCO).
97 for lt_var
in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
99 eval "if test \"\${$lt_var+set}\" = set; then
100 save_$lt_var=\$$lt_var
120 : ${SED="/usr/bin/sed"}
121 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
122 : ${Xsed="$SED -e 1s/^X//"}
127 EXIT_MISMATCH
=63 # $? = 63 is used to indicate version mismatch to missing.
128 EXIT_SKIP
=77 # $? = 77 is used to indicate a skipped test to automake.
130 exit_status
=$EXIT_SUCCESS
132 # Make sure IFS has a sensible default
137 dirname="s,/[^/]*$,,"
140 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
141 # is ksh but when the shell is invoked as "sh" and the current value of
142 # the _XPG environment variable is not equal to 1 (one), the special
143 # positional parameter $0, within a function call, is the name of the
147 # The name of this program:
148 # In the unlikely event $progname began with a '-', it would play havoc with
149 # func_echo (imagine progname=-n), so we prepend ./ in that case:
150 progname
=`$ECHO "X$progpath" | $Xsed -e "$basename" -e 's,^-,./-,'`
152 # Make sure we have an absolute path for reexecution:
154 [\\/]*|
[A-Za-z
]:\\*) ;;
156 progdir
=`$ECHO "X$progpath" | $Xsed -e "$dirname"`
157 progdir
=`cd "$progdir" && pwd`
158 progpath
="$progdir/$progname"
163 for progdir
in $PATH; do
165 test -x "$progdir/$progname" && break
168 test -n "$progdir" || progdir
=`pwd`
169 progpath
="$progdir/$progname"
173 # Sed substitution that helps us do robust quoting. It backslashifies
174 # metacharacters that are still active within double-quoted strings.
175 Xsed
="${SED}"' -e 1s/^X//'
176 sed_quote_subst
='s/\([`"$\\]\)/\\\1/g'
178 # Same as above, but do not quote variable references.
179 double_quote_subst
='s/\(["`\\]\)/\\\1/g'
181 # Re-`\' parameter expansions in output of double_quote_subst that were
182 # `\'-ed in input to the same. If an odd number of `\' preceded a '$'
183 # in input to double_quote_subst, that '$' was protected from expansion.
184 # Since each input `\' is now two `\'s, look for any number of runs of
185 # four `\'s followed by two `\'s and then a '$'. `\' that '$'. Note
186 # that the embedded single quotes serve only to enhance readability.
187 sed_double_backslash
='s/^\(\(''\\\\''\\\\''\)*''\\\\''\)\$/\1\\$/;
188 s/\([^\\]\(''\\\\''\\\\''\)*''\\\\''\)\$/\1\\$/g'
197 # Echo program name prefixed message, along with the current mode
198 # name if it has been set yet.
201 $ECHO "$progname${mode+: }$mode: "${1+"$@"}
204 # func_verbose arg...
205 # Echo program name prefixed message in verbose mode only.
208 $opt_verbose && func_echo
${1+"$@"}
210 # A bug in bash halts the script if the last line of a function
211 # fails when set -e is in force, so we need another command to
217 # Echo program name prefixed message to standard error.
220 $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
223 # func_warning arg...
224 # Echo program name prefixed warning message to standard error.
227 $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
230 # func_fatal_error arg...
231 # Echo program name prefixed message to standard error, and exit.
238 # func_fatal_help arg...
239 # Echo program name prefixed message to standard error, followed by
240 # a help hint, and exit.
244 func_fatal_error
"$help"
246 help="Try \`$progname --help' for more information." ## default
249 # func_grep expression filename
250 # Check whether EXPRESSION matches any line of FILENAME, without output.
253 $GREP "$1" "$2" >/dev
/null
2>&1
257 # func_mkdir_p directory-path
258 # Make sure the entire path to DIRECTORY-PATH is available.
261 my_directory_path
="$1"
264 if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
266 # Protect directory names starting with `-'
267 case $my_directory_path in
268 -*) my_directory_path
="./$my_directory_path" ;;
271 # While some portion of DIR does not yet exist...
272 while test ! -d "$my_directory_path"; do
273 # ...make a list in topmost first order. Use a colon delimited
274 # list incase some portion of path contains whitespace.
275 my_dir_list
="$my_directory_path:$my_dir_list"
277 # If the last portion added has no slash in it, the list is done
278 case $my_directory_path in */*) ;; *) break ;; esac
280 # ...otherwise throw away the child directory and loop
281 my_directory_path
=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
283 my_dir_list
=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
285 save_mkdir_p_IFS
="$IFS"; IFS
=':'
286 for my_dir
in $my_dir_list; do
287 IFS
="$save_mkdir_p_IFS"
288 # mkdir can fail with a `File exist' error if two processes
289 # try to create one of the directories concurrently. Don't
291 $MKDIR "$my_dir" 2>/dev
/null ||
:
293 IFS
="$save_mkdir_p_IFS"
295 # Bail out if we (or some other process) failed to create a directory.
296 test -d "$my_directory_path" || \
297 func_fatal_error
"Failed to create \`$1'"
302 # func_mktempdir [string]
303 # Make a temporary directory that won't clash with other running
304 # libtool processes, and avoids race conditions if possible. If
305 # given, STRING is the basename for that directory.
308 my_template
="${TMPDIR-/tmp}/${1-$progname}"
310 if test "$opt_dry_run" = ":"; then
311 # Return a directory name, but don't create it in dry-run mode
312 my_tmpdir
="${my_template}-$$"
315 # If mktemp works, use that first and foremost
316 my_tmpdir
=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
318 if test ! -d "$my_tmpdir"; then
319 # Failing that, at least try and use $RANDOM to avoid a race
320 my_tmpdir
="${my_template}-${RANDOM-0}$$"
322 save_mktempdir_umask
=`umask`
325 umask $save_mktempdir_umask
328 # If we're not in dry-run mode, bomb out on failure
329 test -d "$my_tmpdir" || \
330 func_fatal_error
"cannot create temporary directory \`$my_tmpdir'"
333 $ECHO "X$my_tmpdir" |
$Xsed
337 # func_quote_for_eval arg
338 # Aesthetically quote ARG to be evaled later.
339 # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
340 # is double-quoted, suitable for a subsequent eval, whereas
341 # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
342 # which are still active within double quotes backslashified.
343 func_quote_for_eval
()
347 func_quote_for_eval_unquoted_result=`$ECHO "X$1" |
$Xsed -e "$sed_quote_subst"` ;;
349 func_quote_for_eval_unquoted_result="$1" ;;
352 case $func_quote_for_eval_unquoted_result in
353 # Double-quote args containing shell metacharacters to delay
354 # word splitting, command substitution and and variable
355 # expansion for a subsequent eval.
356 # Many Bourne shells cannot handle close brackets correctly
357 # in scan sets, so we specify it separately.
358 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
359 func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
362 func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
367 # func_quote_for_expand arg
368 # Aesthetically quote ARG to be evaled later; same as above,
369 # but do not quote variable references.
370 func_quote_for_expand ()
374 my_arg
=`$ECHO "X$1" | $Xsed \
375 -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
381 # Double-quote args containing shell metacharacters to delay
382 # word splitting and command substitution for a subsequent eval.
383 # Many Bourne shells cannot handle close brackets correctly
384 # in scan sets, so we specify it separately.
385 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
390 func_quote_for_expand_result
="$my_arg"
394 # func_show_eval cmd [fail_exp]
395 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
396 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
397 # is given, then evaluate it.
403 ${opt_silent-false} ||
{
404 func_quote_for_expand
"$my_cmd"
405 eval "func_echo $func_quote_for_expand_result"
408 if ${opt_dry_run-false}; then :; else
411 if test "$my_status" -eq 0; then :; else
412 eval "(exit $my_status); $my_fail_exp"
419 # Echo version message to standard output and exit.
422 $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
425 s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
432 # Echo short help message to standard output and exit.
435 $SED -n '/^# Usage:/,/# -h/ {
438 s/\$progname/'$progname'/
442 $ECHO "run \`$progname --help | more' for full usage"
447 # Echo long help message to standard output and exit.
450 $SED -n '/^# Usage:/,/# Report bugs to/ {
453 s*\$progname*'$progname'*
455 s*\$SHELL*'"$SHELL"'*
457 s*\$LTCFLAGS*'"$LTCFLAGS"'*
459 s/\$with_gnu_ld/'"$with_gnu_ld"'/
460 s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
461 s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
467 # func_missing_arg argname
468 # Echo program name prefixed message to standard error and set global
472 func_error
"missing argument for $1"
479 # Check that we have a working $ECHO.
480 if test "X$1" = X--no-reexec
; then
481 # Discard the --no-reexec flag, and continue.
483 elif test "X$1" = X--fallback-echo
; then
484 # Avoid inline document here, it may be left over
486 elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
487 # Yippee, $ECHO works!
490 # Restart under the correct shell, and then maybe $ECHO will work.
491 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
494 if test "X$1" = X--fallback-echo
; then
495 # used as fallback echo
503 magic
="%%%MAGIC variable%%%"
511 lo2o
="s/\\.lo\$/.${objext}/"
512 o2lo
="s/\\.${objext}\$/.lo/"
517 opt_duplicate_deps
=false
521 # If this variable is set in any of the actions, the command in it
522 # will be execed at the end. This prevents here-documents from being
523 # left over by shells.
526 # func_fatal_configuration arg...
527 # Echo program name prefixed message to standard error, followed by
528 # a configuration failure hint, and exit.
529 func_fatal_configuration
()
532 func_error
"See the $PACKAGE documentation for more information."
533 func_fatal_error
"Fatal configuration error."
538 # Display the configuration for all the tags in this script.
541 re_begincf
='^# ### BEGIN LIBTOOL'
542 re_endcf
='^# ### END LIBTOOL'
544 # Default configuration.
545 $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
547 # Now print the configurations for the tags.
548 for tagname
in $taglist; do
549 $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
556 # Display the features supported by this script.
560 if test "$build_libtool_libs" = yes; then
561 $ECHO "enable shared libraries"
563 $ECHO "disable shared libraries"
565 if test "$build_old_libs" = yes; then
566 $ECHO "enable static libraries"
568 $ECHO "disable static libraries"
574 # func_enable_tag tagname
575 # Verify that TAGNAME is valid, and either flag an error and exit, or
576 # enable the TAGNAME tag. We also add TAGNAME to the global $taglist
583 re_begincf
="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
584 re_endcf
="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
585 sed_extractcf
="/$re_begincf/,/$re_endcf/p"
590 func_fatal_error
"invalid tag name: $tagname"
594 # Don't test for the "default" C tag, as we know it's
595 # there but not specially marked.
599 if $GREP "$re_begincf" "$progpath" >/dev
/null
2>&1; then
600 taglist
="$taglist $tagname"
602 # Evaluate the configuration. Be careful to quote the path
603 # and the sed script, to avoid splitting on whitespace, but
604 # also don't use non-portable quotes within backquotes within
605 # quotes we have to do it in 2 steps:
606 extractedcf
=`$SED -n -e "$sed_extractcf" < "$progpath"`
609 func_error
"ignoring unknown tag $tagname"
618 # We need to display help for each of the modes.
621 # Generic help is extracted from the usage comments
622 # at the start of this file.
628 "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
630 Remove files from the build directory.
632 RM is the name of the program to use to delete files associated with each FILE
633 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
636 If FILE is a libtool library, object or program, all the files associated
637 with it are deleted. Otherwise, only FILE itself is deleted using RM."
642 "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
644 Compile a source file into a libtool library object.
646 This mode accepts the following additional options:
648 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
649 -no-suppress do not suppress compiler output for multiple passes
650 -prefer-pic try to building PIC objects only
651 -prefer-non-pic try to building non-PIC objects only
652 -shared do not build a \`.o' file suitable for static linking
653 -static only build a \`.o' file suitable for static linking
655 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
656 from the given SOURCEFILE.
658 The output file name is determined by removing the directory component from
659 SOURCEFILE, then substituting the C source code suffix \`.c' with the
660 library object suffix, \`.lo'."
665 "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
667 Automatically set library path, then run a program.
669 This mode accepts the following additional options:
671 -dlopen FILE add the directory containing FILE to the library path
673 This mode sets the library path environment variable according to \`-dlopen'
676 If any of the ARGS are libtool executable wrappers, then they are translated
677 into their corresponding uninstalled binary, and any of their required library
678 directories are added to the library path.
680 Then, COMMAND is executed, with ARGS as arguments."
685 "Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
687 Complete the installation of libtool libraries.
689 Each LIBDIR is a directory that contains libtool libraries.
691 The commands that this mode executes may require superuser privileges. Use
692 the \`--dry-run' option if you just want to see what would be executed."
697 "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
699 Install executables or libraries.
701 INSTALL-COMMAND is the installation command. The first component should be
702 either the \`install' or \`cp' program.
704 The following components of INSTALL-COMMAND are treated specially:
706 -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation
708 The rest of the components are interpreted as arguments to that command (only
709 BSD-compatible install options are recognized)."
714 "Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
716 Link object files or libraries together to form another library, or to
717 create an executable program.
719 LINK-COMMAND is a command using the C compiler that you would use to create
720 a program from several object files.
722 The following components of LINK-COMMAND are treated specially:
724 -all-static do not do any dynamic linking at all
725 -avoid-version do not add a version suffix if possible
726 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
727 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
728 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
729 -export-symbols SYMFILE
730 try to export only the symbols listed in SYMFILE
731 -export-symbols-regex REGEX
732 try to export only the symbols matching REGEX
733 -LLIBDIR search LIBDIR for required installed libraries
734 -lNAME OUTPUT-FILE requires the installed library libNAME
735 -module build a library that can dlopened
736 -no-fast-install disable the fast-install mode
737 -no-install link a not-installable executable
738 -no-undefined declare that a library does not refer to external symbols
739 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
740 -objectlist FILE Use a list of object files found in FILE to specify objects
741 -precious-files-regex REGEX
742 don't remove output files matching REGEX
743 -release RELEASE specify package release information
744 -rpath LIBDIR the created library will eventually be installed in LIBDIR
745 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
746 -shared only do dynamic linking of libtool libraries
747 -shrext SUFFIX override the standard shared library file extension
748 -static do not do any dynamic linking of uninstalled libtool libraries
750 do not do any dynamic linking of libtool libraries
751 -version-info CURRENT[:REVISION[:AGE]]
752 specify library version info [each variable defaults to 0]
753 -weak LIBNAME declare that the target provides the LIBNAME interface
755 All other options (arguments beginning with \`-') are ignored.
757 Every other argument is treated as a filename. Files ending in \`.la' are
758 treated as uninstalled libtool libraries, other files are standard or library
761 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
762 only library objects (\`.lo' files) may be specified, and \`-rpath' is
763 required, except when creating a convenience library.
765 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
766 using \`ar' and \`ranlib', or on Windows using \`lib'.
768 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
769 is created, otherwise an executable program is created."
774 "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
776 Remove libraries from an installation directory.
778 RM is the name of the program to use to delete files associated with each FILE
779 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
782 If FILE is a libtool library, all the files associated with it are deleted.
783 Otherwise, only FILE itself is deleted using RM."
787 func_fatal_help
"invalid operation mode \`$mode'"
792 $ECHO "Try \`$progname --help' for more information about other modes."
797 # TEST SUITE MARKER ## NON-FUNCTION
798 # Parse options once, thoroughly. This comes as soon as possible in
799 # the script to make things like `libtool --version' happen quickly.
802 my_sed_single_opt
='1s/^\(..\).*$/\1/;q'
803 my_sed_single_rest
='1s/^..\(.*\)$/\1/;q'
804 my_sed_long_opt
='1s/^\(-[^=]*\)=.*/\1/;q'
805 my_sed_long_arg
='1s/^-[^=]*=//'
807 # Shorthand for --mode=foo, only valid as the first argument
810 shift; set dummy
--mode clean
${1+"$@"}; shift
812 compile|compil|compi|comp|com|co|c
)
813 shift; set dummy
--mode compile
${1+"$@"}; shift
815 execute|execut|execu|
exec|exe|ex|e
)
816 shift; set dummy
--mode execute
${1+"$@"}; shift
818 finish|finis|fini|fin|
fi|f
)
819 shift; set dummy
--mode finish
${1+"$@"}; shift
821 install|instal|insta|inst|ins|
in|i
)
822 shift; set dummy
--mode install ${1+"$@"}; shift
825 shift; set dummy
--mode link
${1+"$@"}; shift
827 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u
)
828 shift; set dummy
--mode uninstall
${1+"$@"}; shift
832 # Parse non-mode specific arguments:
833 while test "$#" -gt 0; do
838 --config) func_config
;;
840 --debug) preserve_args
="$preserve_args $opt"
841 func_echo
"enabling shell trace mode"
846 -dlopen) test "$#" -eq 0 && func_missing_arg
"$opt" && break
847 execute_dlfiles
="$execute_dlfiles $1"
851 --dry-run |
-n) opt_dry_run
=: ;;
852 --features) func_features
;;
853 --finish) mode
="finish" ;;
855 --mode) test "$#" -eq 0 && func_missing_arg
"$opt" && break
857 # Valid mode arguments:
867 # Catch anything else as an error
868 *) func_error
"invalid argument for $opt"
879 opt_duplicate_deps
=: ;;
881 --quiet|
--silent) preserve_args
="$preserve_args $opt"
885 --verbose|
-v) preserve_args
="$preserve_args $opt"
889 --tag) test "$#" -eq 0 && func_missing_arg
"$opt" && break
890 preserve_args
="$preserve_args $opt $1"
891 func_enable_tag
"$1" # tagname is set here
895 # Separate optargs to long options:
896 -dlopen=*|
--mode=*|
--tag=*)
897 arg
=`$ECHO "X$opt" | $Xsed -e "$my_sed_long_arg"`
898 opt
=`$ECHO "X$opt" | $Xsed -e "$my_sed_long_opt"`
899 set dummy
"$opt" "$arg" ${1+"$@"}
903 # Separate optargs to short options:
905 # arg=`$ECHO "X$opt" |$Xsed -e "$my_sed_single_rest"`
906 # opt=`$ECHO "X$opt" |$Xsed -e "$my_sed_single_opt"`
907 # set dummy "$opt" "$arg" ${1+"$@"}
911 # Separate non-argument short options:
913 # rest=`$ECHO "X$opt" |$Xsed -e "$my_sed_single_rest"`
914 # opt=`$ECHO "X$opt" |$Xsed -e "$my_sed_single_opt"`
915 # set dummy "$opt" "-$rest" ${1+"$@"}
919 -\?|
-h) func_usage
;;
920 --help) opt_help
=: ;;
921 --version) func_version
;;
923 -*) func_fatal_help
"unrecognized option \`$opt'" ;;
931 # Now that we've collected a possible --mode arg, show help if necessary
932 $opt_help && func_mode_help
935 *cygwin
* |
*mingw
* |
*pw32
*)
936 # don't eliminate duplications in $postdeps and $predeps
937 opt_duplicate_compiler_generated_deps
=:
940 opt_duplicate_compiler_generated_deps
=$opt_duplicate_deps
944 # Having warned about all mis-specified options, bail out if
945 # anything was wrong.
946 $exit_cmd $EXIT_FAILURE
948 # TEST SUITE MARKER ## BEGIN SOURCABLE
950 # func_check_version_match
951 # Ensure that we are using m4 macros, and libtool script from the same
952 # release of libtool.
953 func_check_version_match
()
955 if test "$package_revision" != "$macro_revision"; then
956 if test "$VERSION" != "$macro_version"; then
957 if test -z "$macro_version"; then
959 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
960 $progname: definition of this LT_INIT comes from an older release.
961 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
962 $progname: and run autoconf again.
966 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
967 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
968 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
969 $progname: and run autoconf again.
974 $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
975 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
976 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
977 $progname: of $PACKAGE $VERSION and run autoconf again.
987 # True iff FILE is a libtool `.la' library or `.lo' object file.
988 # This function is only a basic sanity check; it will hardly flush out
989 # determined imposters.
992 $SED -e 4q
"$1" 2>/dev
/null \
993 |
$GREP "^# Generated by .*$PACKAGE" > /dev
/null
2>&1
996 # func_lalib_unsafe_p file
997 # True iff FILE is a libtool `.la' library or `.lo' object file.
998 # This function implements the same check as func_lalib_p without
999 # resorting to external programs. To this end, it redirects stdin and
1000 # closes it afterwards, without saving the original file descriptor.
1001 # As a safety measure, use it only where a negative result would be
1002 # fatal anyway. Works if `file' does not exist.
1003 func_lalib_unsafe_p
()
1006 if test -r "$1" && exec 5<&1 <"$1"; then
1007 for lalib_p_l
in 1 2 3 4
1010 case "$lalib_p_line" in
1011 \
#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
1016 test "$lalib_p" = yes
1019 # func_ltwrapper_p file
1020 # True iff FILE is a libtool wrapper script.
1021 # This function is only a basic sanity check; it will hardly flush out
1022 # determined imposters.
1029 # func_execute_cmds commands fail_cmd
1030 # Execute tilde-delimited COMMANDS.
1031 # If FAIL_CMD is given, eval that upon failure.
1032 # FAIL_CMD may read-access the current command in variable CMD!
1033 func_execute_cmds
()
1036 save_ifs
=$IFS; IFS
='~'
1040 func_show_eval
"$cmd" "${2-:}"
1047 # Source FILE, adding directory component if necessary.
1048 # Note that it is not necessary on cygwin/mingw to append a dot to
1049 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
1050 # behavior happens only for exec(3), not for open(2)! Also, sourcing
1051 # `FILE.' does not work on cygwin managed mounts.
1056 */* |
*\\*) .
"$1" ;;
1062 # Generated shell functions inserted here.
1065 # func_win32_libid arg
1066 # return the library type of file 'arg'
1068 # Need a lot of goo to handle *both* DLLs and import libs
1069 # Has to be a shell function in order to 'eat' the argument
1070 # that is supplied when $file_magic_command is called.
1074 win32_libid_type
="unknown"
1075 win32_fileres
=`file -L $1 2>/dev/null`
1076 case $win32_fileres in
1077 *ar\ archive\ import\ library
*) # definitely import
1078 win32_libid_type
="x86 archive import"
1080 *ar\ archive
*) # could be an import, or static
1081 if eval $OBJDUMP -f $1 |
$SED -e '10q' 2>/dev
/null |
1082 $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev
/null
; then
1083 win32_nmres
=`eval $NM -f posix -A $1 |
1092 case $win32_nmres in
1093 import
*) win32_libid_type
="x86 archive import";;
1094 *) win32_libid_type
="x86 archive static";;
1099 win32_libid_type
="x86 DLL"
1101 *executable
*) # but shell scripts are "executable" too...
1102 case $win32_fileres in
1103 *MS\ Windows\ PE\ Intel
*)
1104 win32_libid_type
="x86 DLL"
1109 $ECHO "$win32_libid_type"
1114 # func_infer_tag arg
1115 # Infer tagged configuration to use if any are available and
1116 # if one wasn't chosen via the "--tag" command line option.
1117 # Only attempt this if the compiler in the base compile
1118 # command doesn't match the default compiler.
1119 # arg is usually of the form 'gcc ...'
1123 if test -n "$available_tags" && test -z "$tagname"; then
1126 func_quote_for_eval
"$arg"
1127 CC_quoted
="$CC_quoted $func_quote_for_eval_result"
1130 # Blanks in the command may have been stripped by the calling shell,
1131 # but not from the CC environment variable when configure was run.
1132 " $CC "* |
"$CC "* |
" `$ECHO $CC` "* |
"`$ECHO $CC` "* |
" $CC_quoted"* |
"$CC_quoted "* |
" `$ECHO $CC_quoted` "* |
"`$ECHO $CC_quoted` "*) ;;
1133 # Blanks at the start of $base_compile will cause this to fail
1134 # if we don't check for them as well.
1136 for z
in $available_tags; do
1137 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev
/null
; then
1138 # Evaluate the configuration.
1139 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1142 # Double-quote args containing other shell metacharacters.
1143 func_quote_for_eval
"$arg"
1144 CC_quoted
="$CC_quoted $func_quote_for_eval_result"
1147 " $CC "* |
"$CC "* |
" `$ECHO $CC` "* |
"`$ECHO $CC` "* |
" $CC_quoted"* |
"$CC_quoted "* |
" `$ECHO $CC_quoted` "* |
"`$ECHO $CC_quoted` "*)
1148 # The compiler in the base compile command matches
1149 # the one in the tagged configuration.
1150 # Assume this is the tagged configuration we want.
1157 # If $tagname still isn't set, then no tagged configuration
1158 # was found and let the user know that the "--tag" command
1159 # line option must be used.
1160 if test -z "$tagname"; then
1161 func_echo
"unable to infer tagged configuration"
1162 func_fatal_error
"specify a tag with \`--tag'"
1164 # func_verbose "using $tagname tagged configuration"
1173 # func_generate_dlsyms outputname originator pic_p
1174 # Extract symbols from dlprefiles and create ${outputname}S.o with
1175 # a dlpreopen symbol table.
1176 func_generate_dlsyms
()
1182 my_prefix
=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
1185 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
1186 if test -n "$NM" && test -n "$global_symbol_pipe"; then
1187 my_dlsyms
="${my_outputname}S.c"
1189 func_error
"not configured to extract global symbols from dlpreopened files"
1193 if test -n "$my_dlsyms"; then
1197 # Discover the nlist of each of the dlfiles.
1198 nlist
="$output_objdir/${my_outputname}.nm"
1200 func_show_eval
"$RM $nlist ${nlist}S ${nlist}T"
1202 # Parse the name list into a source file.
1203 func_echo
"creating $output_objdir/$my_dlsyms"
1205 $opt_dry_run ||
$ECHO > "$output_objdir/$my_dlsyms" "\
1206 /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
1207 /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
1213 /* External symbol declarations for the compiler. */\
1216 if test "$dlself" = yes; then
1217 func_echo
"generating symbol list for \`$output'"
1219 $opt_dry_run ||
echo ': @PROGRAM@ ' > "$nlist"
1221 # Add our own program objects to the symbol list.
1222 progfiles
=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
1223 for progfile
in $progfiles; do
1224 func_echo
"extracting global C symbols from \`$progfile'"
1225 $opt_dry_run ||
eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
1228 if test -n "$exclude_expsyms"; then
1230 eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
1231 eval '$MV "$nlist"T "$nlist"'
1235 if test -n "$export_symbols_regex"; then
1237 eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
1238 eval '$MV "$nlist"T "$nlist"'
1242 # Prepare the list of exported symbols
1243 if test -z "$export_symbols"; then
1244 export_symbols
="$output_objdir/$outputname.exp"
1247 eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
1249 *cygwin
* |
*mingw
* )
1250 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
1251 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
1257 eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
1258 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
1259 eval '$MV "$nlist"T "$nlist"'
1262 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
1263 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
1270 for dlprefile
in $dlprefiles; do
1271 func_echo
"extracting global C symbols from \`$dlprefile'"
1272 func_basename
"$dlprefile"
1273 name
="$func_basename_result"
1275 eval '$ECHO ": $name " >> "$nlist"'
1276 eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
1281 # Make sure we have at least an empty file.
1282 test -f "$nlist" ||
: > "$nlist"
1284 if test -n "$exclude_expsyms"; then
1285 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
1286 $MV "$nlist"T
"$nlist"
1289 # Try sorting and uniquifying the output.
1290 if $GREP -v "^: " < "$nlist" |
1291 if sort -k 3 </dev
/null
>/dev
/null
2>&1; then
1296 uniq > "$nlist"S
; then
1299 $GREP -v "^: " < "$nlist" > "$nlist"S
1302 if test -f "$nlist"S
; then
1303 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
1305 $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
1308 $ECHO >> "$output_objdir/$my_dlsyms" "\
1310 /* The mapping between symbol names and symbols. */
1313 *cygwin
* |
*mingw
* )
1314 $ECHO >> "$output_objdir/$my_dlsyms" "\
1315 /* DATA imports from DLLs on WIN32 con't be const, because
1316 runtime relocations are performed -- see ld's documentation
1317 on pseudo-relocs. */
1322 $ECHO >> "$output_objdir/$my_dlsyms" "\
1328 $ECHO >> "$output_objdir/$my_dlsyms" "\
1332 lt_${my_prefix}_LTX_preloaded_symbols[] =
1334 { \"$my_originator\", (void *) 0 },
1337 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
1339 $ECHO >> "$output_objdir/$my_dlsyms" "\
1343 /* This works around a problem in FreeBSD linker */
1344 #ifdef FREEBSD_WORKAROUND
1345 static const void *lt_preloaded_setup() {
1346 return lt_${my_prefix}_LTX_preloaded_symbols;
1356 pic_flag_for_symtable
=
1357 case "$compile_command " in
1361 # compiling the symbol table file with pic_flag works around
1362 # a FreeBSD bug that causes programs to crash when -lm is
1363 # linked before any other PIC object. But we must not use
1364 # pic_flag when linking with -static. The problem exists in
1365 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
1366 *-*-freebsd2*|
*-*-freebsd3.0
*|
*-*-freebsdelf3.0
*)
1367 pic_flag_for_symtable
=" $pic_flag -DFREEBSD_WORKAROUND" ;;
1369 pic_flag_for_symtable
=" $pic_flag" ;;
1371 if test "X$my_pic_p" != Xno
; then
1372 pic_flag_for_symtable
=" $pic_flag"
1379 for arg
in $LTCFLAGS; do
1381 -pie |
-fpie |
-fPIE) ;;
1382 *) symtab_cflags
="$symtab_cflags $arg" ;;
1386 # Now compile the dynamic symbol file.
1387 func_show_eval
'(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
1389 # Clean up the generated files.
1390 func_show_eval
'$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
1392 # Transform the symbol file into the correct name.
1393 symfileobj
="$output_objdir/${my_outputname}S.$objext"
1395 *cygwin
* |
*mingw
* )
1396 if test -f "$output_objdir/$my_outputname.def"; then
1397 compile_command
=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
1398 finalize_command
=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
1400 compile_command
=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
1401 finalize_command
=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
1405 compile_command
=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
1406 finalize_command
=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
1411 func_fatal_error
"unknown suffix for \`$my_dlsyms'"
1415 # We keep going just in case the user didn't refer to
1416 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
1417 # really was required.
1419 # Nullify the symbol file.
1420 compile_command
=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
1421 finalize_command
=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
1425 # func_extract_an_archive dir oldlib
1426 func_extract_an_archive
()
1429 f_ex_an_ar_dir
="$1"; shift
1430 f_ex_an_ar_oldlib
="$1"
1431 func_show_eval
"(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" 'exit $?'
1432 if ($AR t
"$f_ex_an_ar_oldlib" |
sort |
sort -uc >/dev
/null
2>&1); then
1435 func_fatal_error
"object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
1440 # func_extract_archives gentop oldlib ...
1441 func_extract_archives
()
1444 my_gentop
="$1"; shift
1445 my_oldlibs
=${1+"$@"}
1451 for my_xlib
in $my_oldlibs; do
1452 # Extract the objects.
1454 [\\/]* |
[A-Za-z
]:[\\/]*) my_xabs
="$my_xlib" ;;
1455 *) my_xabs
=`pwd`"/$my_xlib" ;;
1457 func_basename
"$my_xlib"
1458 my_xlib
="$func_basename_result"
1461 case " $extracted_archives " in
1463 extracted_serial
=`expr $extracted_serial + 1`
1464 my_xlib_u
=lt
$extracted_serial-$my_xlib ;;
1468 extracted_archives
="$extracted_archives $my_xlib_u"
1469 my_xdir
="$my_gentop/$my_xlib_u"
1471 func_mkdir_p
"$my_xdir"
1475 func_echo
"Extracting $my_xabs"
1476 # Do not bother doing anything if just a dry run
1478 darwin_orig_dir
=`pwd`
1479 cd $my_xdir ||
exit $?
1480 darwin_archive
=$my_xabs
1482 darwin_base_archive
=`basename $darwin_archive`
1483 darwin_arches
=`lipo -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
1484 if test -n "$darwin_arches"; then
1485 darwin_arches
=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
1487 func_echo
"$darwin_base_archive has multiple architectures $darwin_arches"
1488 for darwin_arch
in $darwin_arches ; do
1489 func_mkdir_p
"unfat-$$/${darwin_base_archive}-${darwin_arch}"
1490 lipo
-thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
1491 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
1492 func_extract_an_archive
"`pwd`" "${darwin_base_archive}"
1494 $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
1495 done # $darwin_arches
1496 ## Okay now we've a bunch of thin objects, gotta fatten them up :)
1497 darwin_filelist
=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
1500 for darwin_file
in $darwin_filelist; do
1501 darwin_files
=`find unfat-$$ -name $darwin_file -print | $NL2SP`
1502 lipo
-create -output "$darwin_file" $darwin_files
1503 done # $darwin_filelist
1505 cd "$darwin_orig_dir"
1508 func_extract_an_archive
"$my_xdir" "$my_xabs"
1513 func_extract_an_archive
"$my_xdir" "$my_xabs"
1516 my_oldobjs
="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
1519 func_extract_archives_result
="$my_oldobjs"
1524 # func_write_libtool_object output_name pic_name nonpic_name
1525 # Create a libtool object file (analogous to a ".la" file),
1526 # but don't create it if we're doing a dry run.
1527 func_write_libtool_object
()
1530 if test "$build_libtool_libs" = yes; then
1536 if test "$build_old_libs" = yes; then
1537 write_oldobj
=\'${3}\'
1543 cat >${write_libobj}T
<<EOF
1544 # $write_libobj - a libtool object file
1545 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
1547 # Please DO NOT delete this file!
1548 # It is necessary for linking the library.
1550 # Name of the PIC object.
1551 pic_object=$write_lobj
1553 # Name of the non-PIC object
1554 non_pic_object=$write_oldobj
1557 mv -f "${write_libobj}T" "${write_libobj}"
1561 # func_mode_compile arg...
1562 func_mode_compile
()
1565 # Get the compilation command and the source file.
1567 srcfile
="$nonopt" # always keep a non-empty value in "srcfile"
1579 # do not "continue". Instead, add this to base_compile
1591 # Accept any command-line options.
1594 test -n "$libobj" && \
1595 func_fatal_error
"you cannot specify \`-o' more than once"
1600 -pie |
-fpie |
-fPIE)
1601 pie_flag
="$pie_flag $arg"
1605 -shared |
-static |
-prefer-pic |
-prefer-non-pic)
1616 arg_mode
=arg
# the next one goes into the "base_compile" arg list
1617 continue # The current "srcfile" will either be retained or
1618 ;; # replaced later. I would guess that would be a bug.
1621 func_stripname
'-Wc,' '' "$arg"
1622 args
=$func_stripname_result
1624 save_ifs
="$IFS"; IFS
=','
1625 for arg
in $args; do
1627 func_quote_for_eval
"$arg"
1628 lastarg
="$lastarg $func_quote_for_eval_result"
1631 func_stripname
' ' '' "$lastarg"
1632 lastarg
=$func_stripname_result
1634 # Add the arguments to base_compile.
1635 base_compile
="$base_compile $lastarg"
1640 # Accept the current argument as the source file.
1641 # The previous "srcfile" becomes the current argument.
1648 esac # case $arg_mode
1650 # Aesthetically quote the previous argument.
1651 func_quote_for_eval
"$lastarg"
1652 base_compile
="$base_compile $func_quote_for_eval_result"
1657 func_fatal_error
"you must specify an argument for -Xcompile"
1660 func_fatal_error
"you must specify a target with \`-o'"
1663 # Get the name of the library object.
1664 test -z "$libobj" && {
1665 func_basename
"$srcfile"
1666 libobj
="$func_basename_result"
1671 # Recognize several different file suffixes.
1672 # If the user specifies -o file.o, it is replaced with file.lo
1682 *.class
) xform
=class
;;
1687 *.java
) xform
=java
;;
1691 libobj
=`$ECHO "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
1694 *.lo
) obj
=`$ECHO "X$libobj" | $Xsed -e "$lo2o"` ;;
1696 func_fatal_error
"cannot determine name of library object from \`$libobj'"
1700 func_infer_tag
$base_compile
1702 for arg
in $later; do
1705 test "$build_libtool_libs" != yes && \
1706 func_fatal_configuration
"can not build a shared library"
1712 build_libtool_libs
=no
1729 func_quote_for_eval
"$libobj"
1730 test "X$libobj" != "X$func_quote_for_eval_result" \
1731 && $ECHO "X$libobj" |
$GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
1732 && func_warning
"libobj name \`$libobj' may not contain shell special characters."
1733 func_basename
"$obj"
1734 objname
="$func_basename_result"
1735 func_dirname
"$obj" "/" ""
1736 xdir
="$func_dirname_result"
1737 lobj
=${xdir}$objdir/$objname
1739 test -z "$base_compile" && \
1740 func_fatal_help
"you must specify a compilation command"
1742 # Delete any leftover library objects.
1743 if test "$build_old_libs" = yes; then
1744 removelist
="$obj $lobj $libobj ${libobj}T"
1746 removelist
="$lobj $libobj ${libobj}T"
1749 $opt_dry_run ||
$RM $removelist
1750 trap "$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE" 1 2 15
1752 # On Cygwin there's no "real" PIC flag so we must build both object types
1754 cygwin
* | mingw
* | pw32
* | os2
*)
1758 if test "$pic_mode" = no
&& test "$deplibs_check_method" != pass_all
; then
1759 # non-PIC code in shared libraries is not supported
1763 # Calculate the filename of the output object if compiler does
1764 # not support -o with -c
1765 if test "$compiler_c_o" = no
; then
1766 output_obj
=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.
${objext}
1767 lockfile
="$output_obj.lock"
1768 removelist
="$removelist $output_obj $lockfile"
1769 trap "$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE" 1 2 15
1776 # Lock this critical section if it is needed
1777 # We use this script file to make the link, it avoids creating a new file
1778 if test "$need_locks" = yes; then
1779 until $opt_dry_run ||
ln "$progpath" "$lockfile" 2>/dev
/null
; do
1780 func_echo
"Waiting for $lockfile to be removed"
1783 elif test "$need_locks" = warn
; then
1784 if test -f "$lockfile"; then
1786 *** ERROR, $lockfile exists and contains:
1787 `cat $lockfile 2>/dev/null`
1789 This indicates that another process is trying to use the same
1790 temporary object file, and libtool could not work around it because
1791 your compiler does not support \`-c' and \`-o' together. If you
1792 repeat this compilation, it may succeed, by chance, but you had better
1793 avoid parallel builds (make -j) in this platform, or get a better
1796 $opt_dry_run ||
$RM $removelist
1799 $ECHO "$srcfile" > "$lockfile"
1802 if test -n "$fix_srcfile_path"; then
1803 eval srcfile
=\"$fix_srcfile_path\"
1805 func_quote_for_eval
"$srcfile"
1806 qsrcfile
=$func_quote_for_eval_result
1808 $opt_dry_run ||
$RM "$libobj" "${libobj}T"
1810 # Only build a PIC object if we are building libtool libraries.
1811 if test "$build_libtool_libs" = yes; then
1812 # Without this assignment, base_compile gets emptied.
1813 fbsd_hideous_sh_bug
=$base_compile
1815 if test "$pic_mode" != no
; then
1816 command="$base_compile $qsrcfile $pic_flag"
1818 # Don't build PIC code
1819 command="$base_compile $qsrcfile"
1822 func_mkdir_p
"$xdir$objdir"
1824 if test -z "$output_obj"; then
1825 # Place PIC objects in $objdir
1826 command="$command -o $lobj"
1829 $opt_dry_run ||
$RM "$lobj" "$output_obj"
1831 func_show_eval
"$command" \
1832 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
1834 if test "$need_locks" = warn
&&
1835 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1837 *** ERROR, $lockfile contains:
1838 `cat $lockfile 2>/dev/null`
1840 but it should contain:
1843 This indicates that another process is trying to use the same
1844 temporary object file, and libtool could not work around it because
1845 your compiler does not support \`-c' and \`-o' together. If you
1846 repeat this compilation, it may succeed, by chance, but you had better
1847 avoid parallel builds (make -j) in this platform, or get a better
1850 $opt_dry_run ||
$RM $removelist
1854 # Just move the object if needed, then go on to compile the next one
1855 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1856 func_show_eval
'$MV "$output_obj" "$lobj"' \
1857 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
1860 # Allow error messages only from the first compilation.
1861 if test "$suppress_opt" = yes; then
1862 suppress_output
=' >/dev/null 2>&1'
1866 # Only build a position-dependent object if we build old libraries.
1867 if test "$build_old_libs" = yes; then
1868 if test "$pic_mode" != yes; then
1869 # Don't build PIC code
1870 command="$base_compile $qsrcfile$pie_flag"
1872 command="$base_compile $qsrcfile $pic_flag"
1874 if test "$compiler_c_o" = yes; then
1875 command="$command -o $obj"
1878 # Suppress compiler output if we already did a PIC compilation.
1879 command="$command$suppress_output"
1880 $opt_dry_run ||
$RM "$obj" "$output_obj"
1881 func_show_eval
"$command" \
1882 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
1884 if test "$need_locks" = warn
&&
1885 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1887 *** ERROR, $lockfile contains:
1888 `cat $lockfile 2>/dev/null`
1890 but it should contain:
1893 This indicates that another process is trying to use the same
1894 temporary object file, and libtool could not work around it because
1895 your compiler does not support \`-c' and \`-o' together. If you
1896 repeat this compilation, it may succeed, by chance, but you had better
1897 avoid parallel builds (make -j) in this platform, or get a better
1900 $opt_dry_run ||
$RM $removelist
1904 # Just move the object if needed
1905 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1906 func_show_eval
'$MV "$output_obj" "$obj"' \
1907 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
1912 func_write_libtool_object
"$libobj" "$objdir/$objname" "$objname"
1914 # Unlock the critical section if it was locked
1915 if test "$need_locks" != no
; then
1924 # func_mode_execute arg...
1925 func_mode_execute
()
1928 # The first argument is the command name.
1931 func_fatal_help
"you must specify a COMMAND"
1933 # Handle -dlopen flags immediately.
1934 for file in $execute_dlfiles; do
1936 || func_fatal_help
"\`$file' is not a file"
1941 # Check to see that this really is a libtool archive.
1942 func_lalib_unsafe_p
"$file" \
1943 || func_fatal_help
"\`$lib' is not a valid libtool archive"
1945 # Read the libtool library.
1950 # Skip this library if it cannot be dlopened.
1951 if test -z "$dlname"; then
1952 # Warn if it was a shared library.
1953 test -n "$library_names" && \
1954 func_warning
"\`$file' was not linked with \`-export-dynamic'"
1958 func_dirname
"$file" "" "."
1959 dir
="$func_dirname_result"
1961 if test -f "$dir/$objdir/$dlname"; then
1964 if test ! -f "$dir/$dlname"; then
1965 func_fatal_error
"cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
1971 # Just add the directory containing the .lo file.
1972 func_dirname
"$file" "" "."
1973 dir
="$func_dirname_result"
1977 func_warning
"\`-dlopen' is ignored for non-libtool libraries and objects"
1982 # Get the absolute pathname.
1983 absdir
=`cd "$dir" && pwd`
1984 test -n "$absdir" && dir
="$absdir"
1986 # Now add the directory to shlibpath_var.
1987 if eval "test -z \"\$$shlibpath_var\""; then
1988 eval "$shlibpath_var=\"\$dir\""
1990 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
1994 # This variable tells wrapper scripts just to set shlibpath_var
1995 # rather than running their programs.
1996 libtool_execute_magic
="$magic"
1998 # Check if any of the arguments is a wrapper script.
2005 # Do a test to see if this is really a libtool program.
2006 if func_ltwrapper_p
"$file"; then
2009 # Transform arg to wrapped name.
2010 file="$progdir/$program"
2014 # Quote arguments (to preserve shell metacharacters).
2015 func_quote_for_eval
"$file"
2016 args
="$args $func_quote_for_eval_result"
2019 if test "X$opt_dry_run" = Xfalse
; then
2020 if test -n "$shlibpath_var"; then
2021 # Export the shlibpath_var.
2022 eval "export $shlibpath_var"
2025 # Restore saved environment variables
2026 for lt_var
in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
2028 eval "if test \"\${save_$lt_var+set}\" = set; then
2029 $lt_var=\$save_$lt_var; export $lt_var
2035 # Now prepare to actually exec the command.
2036 exec_cmd
="\$cmd$args"
2038 # Display what would be done.
2039 if test -n "$shlibpath_var"; then
2040 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
2041 $ECHO "export $shlibpath_var"
2049 # func_mode_finish arg...
2056 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
2059 libdirs
="$libdirs $dir"
2062 for libdir
in $libdirs; do
2063 if test -n "$finish_cmds"; then
2064 # Do each command in the finish commands.
2065 func_execute_cmds
"$finish_cmds" 'admincmds="$admincmds
2068 if test -n "$finish_eval"; then
2069 # Do the single finish_eval.
2070 eval cmds
=\"$finish_eval\"
2071 $opt_dry_run ||
eval "$cmds" || admincmds
="$admincmds
2077 # Exit here if they wanted silent mode.
2078 $opt_silent && exit $EXIT_SUCCESS
2080 $ECHO "X----------------------------------------------------------------------" |
$Xsed
2081 $ECHO "Libraries have been installed in:"
2082 for libdir
in $libdirs; do
2086 $ECHO "If you ever happen to want to link against installed libraries"
2087 $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
2088 $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
2089 $ECHO "flag during linking and do at least one of the following:"
2090 if test -n "$shlibpath_var"; then
2091 $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable"
2092 $ECHO " during execution"
2094 if test -n "$runpath_var"; then
2095 $ECHO " - add LIBDIR to the \`$runpath_var' environment variable"
2096 $ECHO " during linking"
2098 if test -n "$hardcode_libdir_flag_spec"; then
2100 eval flag
=\"$hardcode_libdir_flag_spec\"
2102 $ECHO " - use the \`$flag' linker flag"
2104 if test -n "$admincmds"; then
2105 $ECHO " - have your system administrator run these commands:$admincmds"
2107 if test -f /etc
/ld.so.conf
; then
2108 $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
2112 $ECHO "See any operating system documentation about shared libraries for"
2114 solaris2.
[6789]|solaris2.1
[0-9])
2115 $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
2119 $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
2122 $ECHO "X----------------------------------------------------------------------" |
$Xsed
2127 # func_mode_install arg...
2128 func_mode_install
()
2131 # There may be an optional sh(1) argument at the beginning of
2132 # install_prog (especially on Windows NT).
2133 if test "$nonopt" = "$SHELL" ||
test "$nonopt" = /bin
/sh ||
2134 # Allow the use of GNU shtool's install command.
2135 $ECHO "X$nonopt" |
$GREP shtool
>/dev
/null
; then
2136 # Aesthetically quote it.
2137 func_quote_for_eval
"$nonopt"
2138 install_prog
="$func_quote_for_eval_result "
2146 # The real first argument should be the name of the installation program.
2147 # Aesthetically quote it.
2148 func_quote_for_eval
"$arg"
2149 install_prog
="$install_prog$func_quote_for_eval_result"
2151 # We need to accept at least all the BSD install flags.
2161 if test -n "$dest"; then
2162 files
="$files $dest"
2170 case " $install_prog " in
2185 # If the previous option needed an argument, then skip it.
2186 if test -n "$prev"; then
2195 # Aesthetically quote the argument.
2196 func_quote_for_eval
"$arg"
2197 install_prog
="$install_prog $func_quote_for_eval_result"
2200 test -z "$install_prog" && \
2201 func_fatal_help
"you must specify an install program"
2203 test -n "$prev" && \
2204 func_fatal_help
"the \`$prev' option requires an argument"
2206 if test -z "$files"; then
2207 if test -z "$dest"; then
2208 func_fatal_help
"no file or destination specified"
2210 func_fatal_help
"you must specify a destination"
2214 # Strip any trailing slash from the destination.
2215 func_stripname
'' '/' "$dest"
2216 dest
=$func_stripname_result
2218 # Check to see that the destination is a directory.
2219 test -d "$dest" && isdir
=yes
2220 if test "$isdir" = yes; then
2224 func_dirname
"$dest" "" "."
2225 destdir
="$func_dirname_result"
2226 func_basename
"$dest"
2227 destname
="$func_basename_result"
2229 # Not a directory, so check to see that there is only one file specified.
2230 set dummy
$files; shift
2231 test "$#" -gt 1 && \
2232 func_fatal_help
"\`$dest' is not a directory"
2235 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
2237 for file in $files; do
2241 func_fatal_help
"\`$destdir' must be an absolute directory name"
2248 # This variable tells wrapper scripts just to set variables rather
2249 # than running their programs.
2250 libtool_install_magic
="$magic"
2255 for file in $files; do
2257 # Do each installation.
2260 # Do the static libraries later.
2261 staticlibs
="$staticlibs $file"
2265 # Check to see that this really is a libtool archive.
2266 func_lalib_unsafe_p
"$file" \
2267 || func_fatal_help
"\`$file' is not a valid libtool archive"
2274 # Add the libdir to current_libdirs if it is the destination.
2275 if test "X$destdir" = "X$libdir"; then
2276 case "$current_libdirs " in
2278 *) current_libdirs
="$current_libdirs $libdir" ;;
2281 # Note the libdir as a future libdir.
2282 case "$future_libdirs " in
2284 *) future_libdirs
="$future_libdirs $libdir" ;;
2288 func_dirname
"$file" "/" ""
2289 dir
="$func_dirname_result"
2292 if test -n "$relink_command"; then
2293 # Determine the prefix the user has applied to our future dir.
2294 inst_prefix_dir
=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
2296 # Don't allow the user to place us outside of our expected
2297 # location b/c this prevents finding dependent libraries that
2298 # are installed to the same prefix.
2299 # At present, this check doesn't affect windows .dll's that
2300 # are installed into $libdir/../bin (currently, that works fine)
2301 # but it's something to keep an eye on.
2302 test "$inst_prefix_dir" = "$destdir" && \
2303 func_fatal_error
"error: cannot install \`$file' to a directory not ending in $libdir"
2305 if test -n "$inst_prefix_dir"; then
2306 # Stick the inst_prefix_dir data into the link command.
2307 relink_command
=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
2309 relink_command
=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
2312 func_warning
"relinking \`$file'"
2313 func_show_eval
"$relink_command" \
2314 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
2317 # See the names of the shared library.
2318 set dummy
$library_names; shift
2319 if test -n "$1"; then
2324 test -n "$relink_command" && srcname
="$realname"T
2326 # Install the shared library and build the symlinks.
2327 func_show_eval
"$install_prog $dir/$srcname $destdir/$realname" \
2331 cygwin
* | mingw
* | pw32
*)
2339 if test -n "$tstripme" && test -n "$striplib"; then
2340 func_show_eval
"$striplib $destdir/$realname" 'exit $?'
2343 if test "$#" -gt 0; then
2344 # Delete the old symlinks, and create new ones.
2345 # Try `ln -sf' first, because the `ln' binary might depend on
2346 # the symlink we replace! Solaris /bin/ln does not understand -f,
2347 # so we also need to try rm && ln -s.
2350 test "$linkname" != "$realname" \
2351 && func_show_eval
"(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
2355 # Do each command in the postinstall commands.
2356 lib
="$destdir/$realname"
2357 func_execute_cmds
"$postinstall_cmds" 'exit $?'
2360 # Install the pseudo-library for information purposes.
2361 func_basename
"$file"
2362 name
="$func_basename_result"
2363 instname
="$dir/$name"i
2364 func_show_eval
"$install_prog $instname $destdir/$name" 'exit $?'
2366 # Maybe install the static library, too.
2367 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
2371 # Install (i.e. copy) a libtool object.
2373 # Figure out destination file name, if it wasn't already specified.
2374 if test -n "$destname"; then
2375 destfile
="$destdir/$destname"
2377 func_basename
"$file"
2378 destfile
="$func_basename_result"
2379 destfile
="$destdir/$destfile"
2382 # Deduce the name of the destination old-style object file.
2385 staticdest
=`$ECHO "X$destfile" | $Xsed -e "$lo2o"`
2388 staticdest
="$destfile"
2392 func_fatal_help
"cannot copy a libtool object to \`$destfile'"
2396 # Install the libtool object if requested.
2397 test -n "$destfile" && \
2398 func_show_eval
"$install_prog $file $destfile" 'exit $?'
2400 # Install the old object if enabled.
2401 if test "$build_old_libs" = yes; then
2402 # Deduce the name of the old-style object file.
2403 staticobj
=`$ECHO "X$file" | $Xsed -e "$lo2o"`
2404 func_show_eval
"$install_prog \$staticobj \$staticdest" 'exit $?'
2410 # Figure out destination file name, if it wasn't already specified.
2411 if test -n "$destname"; then
2412 destfile
="$destdir/$destname"
2414 func_basename
"$file"
2415 destfile
="$func_basename_result"
2416 destfile
="$destdir/$destfile"
2419 # If the file is missing, and there is a .exe on the end, strip it
2420 # because it is most likely a libtool script we actually want to
2425 if test ! -f "$file"; then
2426 func_stripname
'' '.exe' "$file"
2427 file=$func_stripname_result
2433 # Do a test to see if this is really a libtool program.
2436 func_stripname
'' '.exe' "$file"
2437 wrapper
=$func_stripname_result
2443 if func_ltwrapper_p
"$wrapper"; then
2447 func_source
"$wrapper"
2449 # Check the variables that should have been set.
2450 test -z "$generated_by_libtool_version" && \
2451 func_fatal_error
"invalid libtool wrapper script \`$wrapper'"
2454 for lib
in $notinst_deplibs; do
2455 # Check to see that each library is installed.
2457 if test -f "$lib"; then
2460 libfile
="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
2461 if test -n "$libdir" && test ! -f "$libfile"; then
2462 func_warning
"\`$lib' has not been installed in \`$libdir'"
2468 func_source
"$wrapper"
2471 if test "$fast_install" = no
&& test -n "$relink_command"; then
2473 if test "$finalize" = yes; then
2474 tmpdir
=`func_mktempdir`
2475 func_basename
"$file$stripped_ext"
2476 file="$func_basename_result"
2477 outputname
="$tmpdir/$file"
2478 # Replace the output file specification.
2479 relink_command
=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
2482 func_quote_for_expand
"$relink_command"
2483 eval "func_echo $func_quote_for_expand_result"
2485 if eval "$relink_command"; then :
2487 func_error
"error: relink \`$file' with the above command before installing it"
2488 $opt_dry_run ||
${RM}r
"$tmpdir"
2493 func_warning
"cannot relink \`$file'"
2497 # Install the binary that we compiled earlier.
2498 file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
2502 # remove .exe since cygwin /usr/bin/install will append another
2504 case $install_prog,$host in
2505 */usr
/bin
/install*,*cygwin
*)
2506 case $file:$destfile in
2511 destfile
=$destfile.exe
2514 func_stripname
'' '.exe' "$destfile"
2515 destfile
=$func_stripname_result
2520 func_show_eval
"$install_prog\$stripme \$file \$destfile" 'exit $?'
2521 $opt_dry_run ||
if test -n "$outputname"; then
2528 for file in $staticlibs; do
2529 func_basename
"$file"
2530 name
="$func_basename_result"
2532 # Set up the ranlib parameters.
2533 oldlib
="$destdir/$name"
2535 func_show_eval
"$install_prog \$file \$oldlib" 'exit $?'
2537 if test -n "$stripme" && test -n "$old_striplib"; then
2538 func_show_eval
"$old_striplib $oldlib" 'exit $?'
2541 # Do each command in the postinstall commands.
2542 func_execute_cmds
"$old_postinstall_cmds" 'exit $?'
2545 test -n "$future_libdirs" && \
2546 func_warning
"remember to run \`$progname --finish$future_libdirs'"
2548 if test -n "$current_libdirs"; then
2549 # Maybe just do a dry run.
2550 $opt_dry_run && current_libdirs
=" -n$current_libdirs"
2551 exec_cmd
='$SHELL $progpath $preserve_args --finish$current_libdirs'
2558 # func_mode_link arg...
2563 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
2564 # It is impossible to link a dll without this setting, and
2565 # we shouldn't force the makefile maintainer to figure out
2566 # which system we are compiling for in order to pass an extra
2567 # flag for every libtool invocation.
2568 # allow_undefined=no
2570 # FIXME: Unfortunately, there are problems with the above when trying
2571 # to make a dll which has undefined symbols, in which case not
2572 # even a static library is built. For now, we need to specify
2573 # -no-undefined on the libtool link line when we can be certain
2574 # that all symbols are satisfied, otherwise we get a static library.
2581 libtool_args
=$nonopt
2582 base_compile
="$nonopt $@"
2583 compile_command
=$nonopt
2584 finalize_command
=$nonopt
2597 lib_search_path
=`pwd`
2599 new_inherited_linker_flags
=
2607 export_symbols_regex
=
2615 precious_files_regex
=
2616 prefer_static_libs
=no
2629 single_module
="${wl}-single_module"
2630 func_infer_tag
$base_compile
2632 # We need to know -static, to get the right output filenames.
2637 test "$build_libtool_libs" != yes && \
2638 func_fatal_configuration
"can not build a shared library"
2642 -all-static |
-static |
-static-libtool-libs)
2645 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
2646 func_warning
"complete static linking is impossible in this configuration"
2648 if test -n "$link_static_flag"; then
2649 dlopen_self
=$dlopen_self_static
2650 # See comment for -static flag below, for more details.
2651 func_append compile_command
" $link_static_flag"
2652 func_append finalize_command
" $link_static_flag"
2654 prefer_static_libs
=yes
2657 if test -z "$pic_flag" && test -n "$link_static_flag"; then
2658 dlopen_self
=$dlopen_self_static
2660 prefer_static_libs
=built
2662 -static-libtool-libs)
2663 if test -z "$pic_flag" && test -n "$link_static_flag"; then
2664 dlopen_self
=$dlopen_self_static
2666 prefer_static_libs
=yes
2669 build_libtool_libs
=no
2676 # See if our shared archives depend on static archives.
2677 test -n "$old_archive_from_new_cmds" && build_old_libs
=yes
2679 # Go through the arguments, transforming them on the way.
2680 while test "$#" -gt 0; do
2683 func_quote_for_eval
"$arg"
2684 qarg
=$func_quote_for_eval_unquoted_result
2685 func_append libtool_args
" $func_quote_for_eval_result"
2687 # If the previous option needs an argument, assign it.
2688 if test -n "$prev"; then
2691 func_append compile_command
" @OUTPUT@"
2692 func_append finalize_command
" @OUTPUT@"
2698 if test "$preload" = no
; then
2699 # Add the symbol object into the linking commands.
2700 func_append compile_command
" @SYMFILE@"
2701 func_append finalize_command
" @SYMFILE@"
2705 *.la |
*.lo
) ;; # We handle these cases below.
2707 if test "$dlself" = no
; then
2715 if test "$prev" = dlprefiles
; then
2717 elif test "$prev" = dlfiles
&& test "$dlopen_self" != yes; then
2727 if test "$prev" = dlfiles
; then
2728 dlfiles
="$dlfiles $arg"
2730 dlprefiles
="$dlprefiles $arg"
2738 export_symbols
="$arg"
2740 || func_fatal_error
"symbol file \`$arg' does not exist"
2745 export_symbols_regex
="$arg"
2753 *" $qarg.ltframework "*) ;;
2754 *) deplibs
="$deplibs $qarg.ltframework" # this is fixed later
2763 inst_prefix_dir
="$arg"
2768 if test -f "$arg"; then
2771 for fil
in `cat "$save_arg"`
2773 # moreargs="$moreargs $fil"
2775 # A libtool-controlled object.
2777 # Check to see that this really is a libtool object.
2778 if func_lalib_unsafe_p
"$arg"; then
2785 if test -z "$pic_object" ||
2786 test -z "$non_pic_object" ||
2787 test "$pic_object" = none
&&
2788 test "$non_pic_object" = none
; then
2789 func_fatal_error
"cannot find name of object for \`$arg'"
2792 # Extract subdirectory from the argument.
2793 func_dirname
"$arg" "/" ""
2794 xdir
="$func_dirname_result"
2796 if test "$pic_object" != none
; then
2797 # Prepend the subdirectory the object is found in.
2798 pic_object
="$xdir$pic_object"
2800 if test "$prev" = dlfiles
; then
2801 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
2802 dlfiles
="$dlfiles $pic_object"
2806 # If libtool objects are unsupported, then we need to preload.
2811 # CHECK ME: I think I busted this. -Ossama
2812 if test "$prev" = dlprefiles
; then
2813 # Preload the old-style object.
2814 dlprefiles
="$dlprefiles $pic_object"
2819 func_append libobjs
" $pic_object"
2824 if test "$non_pic_object" != none
; then
2825 # Prepend the subdirectory the object is found in.
2826 non_pic_object
="$xdir$non_pic_object"
2828 # A standard non-PIC object
2829 func_append non_pic_objects
" $non_pic_object"
2830 if test -z "$pic_object" ||
test "$pic_object" = none
; then
2831 arg
="$non_pic_object"
2834 # If the PIC object exists, use it instead.
2835 # $xdir was prepended to $pic_object above.
2836 non_pic_object
="$pic_object"
2837 func_append non_pic_objects
" $non_pic_object"
2840 # Only an error if not doing a dry-run.
2841 if $opt_dry_run; then
2842 # Extract subdirectory from the argument.
2843 func_dirname
"$arg" "/" ""
2844 xdir
="$func_dirname_result"
2846 pic_object
=`$ECHO "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
2847 non_pic_object
=`$ECHO "X${xdir}${arg}" | $Xsed -e "$lo2o"`
2848 func_append libobjs
" $pic_object"
2849 func_append non_pic_objects
" $non_pic_object"
2851 func_fatal_error
"\`$arg' is not a valid libtool object"
2856 func_fatal_error
"link input file \`$arg' does not exist"
2863 precious_files_regex
="$arg"
2873 # We need an absolute path.
2875 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
2877 func_fatal_error
"only absolute run-paths are allowed"
2880 if test "$prev" = rpath
; then
2883 *) rpath
="$rpath $arg" ;;
2888 *) xrpath
="$xrpath $arg" ;;
2900 weak_libs
="$weak_libs $arg"
2905 linker_flags
="$linker_flags $qarg"
2906 compiler_flags
="$compiler_flags $qarg"
2908 func_append compile_command
" $qarg"
2909 func_append finalize_command
" $qarg"
2913 compiler_flags
="$compiler_flags $qarg"
2915 func_append compile_command
" $qarg"
2916 func_append finalize_command
" $qarg"
2920 linker_flags
="$linker_flags $qarg"
2921 compiler_flags
="$compiler_flags $wl$qarg"
2923 func_append compile_command
" $wl$qarg"
2924 func_append finalize_command
" $wl$qarg"
2928 eval "$prev=\"\$arg\""
2933 fi # test -n "$prev"
2939 # The effects of -all-static are defined in a previous loop.
2944 # FIXME: remove this flag sometime in the future.
2945 func_fatal_error
"\`-allow-undefined' must not be used because it is the default"
2968 -export-symbols |
-export-symbols-regex)
2969 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
2970 func_fatal_error
"more than one -exported-symbols argument is not allowed"
2972 if test "X$arg" = "X-export-symbols"; then
2990 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
2991 # so, if we see these flags be careful not to treat them like -L
2993 case $with_gcc/$host in
2994 no
/*-*-irix* |
/*-*-irix*)
2995 func_append compile_command
" $arg"
2996 func_append finalize_command
" $arg"
3003 func_stripname
'-L' '' "$arg"
3004 dir
=$func_stripname_result
3005 # We need an absolute path.
3007 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
3009 absdir
=`cd "$dir" && pwd`
3010 test -z "$absdir" && \
3011 func_fatal_error
"cannot determine absolute directory name of \`$dir'"
3018 deplibs
="$deplibs -L$dir"
3019 lib_search_path
="$lib_search_path $dir"
3023 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
3024 testbindir
=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
3025 case :$dllsearchpath: in
3027 *) dllsearchpath
="$dllsearchpath:$dir";;
3029 case :$dllsearchpath: in
3030 *":$testbindir:"*) ;;
3031 *) dllsearchpath
="$dllsearchpath:$testbindir";;
3039 if test "X$arg" = "X-lc" ||
test "X$arg" = "X-lm"; then
3041 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-beos*)
3042 # These systems don't actually have a C or math library (as such)
3046 # These systems don't actually have a C library (as such)
3047 test "X$arg" = "X-lc" && continue
3049 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
3050 # Do not include libc due to us having libc/libc_r.
3051 test "X$arg" = "X-lc" && continue
3053 *-*-rhapsody* |
*-*-darwin1.
[012])
3054 # Rhapsody C and math libraries are in the System framework
3055 deplibs
="$deplibs System.ltframework"
3058 *-*-sco3.2v5
* |
*-*-sco5v6*)
3059 # Causes problems with __ctype
3060 test "X$arg" = "X-lc" && continue
3062 *-*-sysv4.2uw2
* |
*-*-sysv5* |
*-*-unixware* |
*-*-OpenUNIX*)
3063 # Compiler inserts libc in the correct place for threads to work
3064 test "X$arg" = "X-lc" && continue
3067 elif test "X$arg" = "X-lc_r"; then
3069 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
3070 # Do not include libc_r directly, use -pthread flag.
3075 deplibs
="$deplibs $arg"
3084 # Tru64 UNIX uses -model [arg] to determine the layout of C++
3085 # classes, name mangling, and exception handling.
3086 # Darwin uses the -arch flag to determine output architecture.
3087 -model|
-arch|
-isysroot)
3088 compiler_flags
="$compiler_flags $arg"
3089 func_append compile_command
" $arg"
3090 func_append finalize_command
" $arg"
3095 -mt|
-mthreads|
-kthread|
-Kthread|
-pthread|
-pthreads|
--thread-safe|
-threads)
3096 compiler_flags
="$compiler_flags $arg"
3097 func_append compile_command
" $arg"
3098 func_append finalize_command
" $arg"
3099 case "$new_inherited_linker_flags " in
3101 * ) new_inherited_linker_flags
="$new_inherited_linker_flags $arg" ;;
3107 single_module
="${wl}-multi_module"
3118 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
3119 # The PATH hackery in wrapper scripts is required on Windows
3120 # in order for the loader to find any dlls it needs.
3121 func_warning
"\`-no-install' is ignored for $host"
3122 func_warning
"assuming \`-no-fast-install' instead"
3125 *) no_install
=yes ;;
3142 -precious-files-regex)
3163 func_stripname
'-R' '' "$arg"
3164 dir
=$func_stripname_result
3165 # We need an absolute path.
3167 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
3169 func_fatal_error
"only absolute run-paths are allowed"
3174 *) xrpath
="$xrpath $dir" ;;
3180 # The effects of -shared are defined in a previous loop.
3189 -static |
-static-libtool-libs)
3190 # The effects of -static are defined in a previous loop.
3191 # We used to do the same as -all-static on platforms that
3192 # didn't have a PIC flag, but the assumption that the effects
3193 # would be equivalent was wrong. It would break on at least
3194 # Digital Unix and AIX.
3220 func_stripname
'-Wc,' '' "$arg"
3221 args
=$func_stripname_result
3223 save_ifs
="$IFS"; IFS
=','
3224 for flag
in $args; do
3226 func_quote_for_eval
"$flag"
3227 arg
="$arg $wl$func_quote_for_eval_result"
3228 compiler_flags
="$compiler_flags $func_quote_for_eval_result"
3231 func_stripname
' ' '' "$arg"
3232 arg
=$func_stripname_result
3236 func_stripname
'-Wl,' '' "$arg"
3237 args
=$func_stripname_result
3239 save_ifs
="$IFS"; IFS
=','
3240 for flag
in $args; do
3242 func_quote_for_eval
"$flag"
3243 arg
="$arg $wl$func_quote_for_eval_result"
3244 compiler_flags
="$compiler_flags $wl$func_quote_for_eval_result"
3245 linker_flags
="$linker_flags $func_quote_for_eval_result"
3248 func_stripname
' ' '' "$arg"
3249 arg
=$func_stripname_result
3267 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
3268 # -r[0-9][0-9]* specifies the processor on the SGI compiler
3269 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
3270 # +DA*, +DD* enable 64-bit mode on the HP compiler
3271 # -q* pass through compiler args for the IBM compiler
3272 # -m*, -t[45]*, -txscale* pass through architecture-specific
3273 # compiler args for GCC
3274 # @file GCC response files
3275 -64|
-mips[0-9]|
-r[0-9][0-9]*|
-xarch=*|
-xtarget=*|
+DA
*|
+DD
*|
-q*|
-m*| \
3276 -t[45]*|
-txscale*|@
*)
3277 func_quote_for_eval
"$arg"
3278 arg
="$func_quote_for_eval_result"
3279 func_append compile_command
" $arg"
3280 func_append finalize_command
" $arg"
3281 compiler_flags
="$compiler_flags $arg"
3285 # Some other compiler flag.
3287 func_quote_for_eval
"$arg"
3288 arg
="$func_quote_for_eval_result"
3292 # A standard object.
3297 # A libtool-controlled object.
3299 # Check to see that this really is a libtool object.
3300 if func_lalib_unsafe_p
"$arg"; then
3307 if test -z "$pic_object" ||
3308 test -z "$non_pic_object" ||
3309 test "$pic_object" = none
&&
3310 test "$non_pic_object" = none
; then
3311 func_fatal_error
"cannot find name of object for \`$arg'"
3314 # Extract subdirectory from the argument.
3315 func_dirname
"$arg" "/" ""
3316 xdir
="$func_dirname_result"
3318 if test "$pic_object" != none
; then
3319 # Prepend the subdirectory the object is found in.
3320 pic_object
="$xdir$pic_object"
3322 if test "$prev" = dlfiles
; then
3323 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
3324 dlfiles
="$dlfiles $pic_object"
3328 # If libtool objects are unsupported, then we need to preload.
3333 # CHECK ME: I think I busted this. -Ossama
3334 if test "$prev" = dlprefiles
; then
3335 # Preload the old-style object.
3336 dlprefiles
="$dlprefiles $pic_object"
3341 func_append libobjs
" $pic_object"
3346 if test "$non_pic_object" != none
; then
3347 # Prepend the subdirectory the object is found in.
3348 non_pic_object
="$xdir$non_pic_object"
3350 # A standard non-PIC object
3351 func_append non_pic_objects
" $non_pic_object"
3352 if test -z "$pic_object" ||
test "$pic_object" = none
; then
3353 arg
="$non_pic_object"
3356 # If the PIC object exists, use it instead.
3357 # $xdir was prepended to $pic_object above.
3358 non_pic_object
="$pic_object"
3359 func_append non_pic_objects
" $non_pic_object"
3362 # Only an error if not doing a dry-run.
3363 if $opt_dry_run; then
3364 # Extract subdirectory from the argument.
3365 func_dirname
"$arg" "/" ""
3366 xdir
="$func_dirname_result"
3368 pic_object
=`$ECHO "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
3369 non_pic_object
=`$ECHO "X${xdir}${arg}" | $Xsed -e "$lo2o"`
3370 func_append libobjs
" $pic_object"
3371 func_append non_pic_objects
" $non_pic_object"
3373 func_fatal_error
"\`$arg' is not a valid libtool object"
3380 deplibs
="$deplibs $arg"
3381 old_deplibs
="$old_deplibs $arg"
3386 # A libtool-controlled library.
3388 if test "$prev" = dlfiles
; then
3389 # This library was specified with -dlopen.
3390 dlfiles
="$dlfiles $arg"
3392 elif test "$prev" = dlprefiles
; then
3393 # The library was specified with -dlpreopen.
3394 dlprefiles
="$dlprefiles $arg"
3397 deplibs
="$deplibs $arg"
3402 # Some other compiler argument.
3404 # Unknown arguments in both finalize_command and compile_command need
3405 # to be aesthetically quoted because they are evaled later.
3406 func_quote_for_eval
"$arg"
3407 arg
="$func_quote_for_eval_result"
3411 # Now actually substitute the argument into the commands.
3412 if test -n "$arg"; then
3413 func_append compile_command
" $arg"
3414 func_append finalize_command
" $arg"
3416 done # argument parsing loop
3418 test -n "$prev" && \
3419 func_fatal_help
"the \`$prevarg' option requires an argument"
3421 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
3422 eval arg
=\"$export_dynamic_flag_spec\"
3423 func_append compile_command
" $arg"
3424 func_append finalize_command
" $arg"
3428 # calculate the name of the file, without its directory
3429 func_basename
"$output"
3430 outputname
="$func_basename_result"
3431 libobjs_save
="$libobjs"
3433 if test -n "$shlibpath_var"; then
3434 # get the directories listed in $shlibpath_var
3435 eval shlib_search_path
=\
`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
3439 eval sys_lib_search_path
=\"$sys_lib_search_path_spec\"
3440 eval sys_lib_dlsearch_path
=\"$sys_lib_dlsearch_path_spec\"
3442 func_dirname
"$output" "/" ""
3443 output_objdir
="$func_dirname_result$objdir"
3444 # Create the object directory.
3445 func_mkdir_p
"$output_objdir"
3447 # Determine the type of output
3450 func_fatal_help
"you must specify an output file"
3452 *.
$libext) linkmode
=oldlib
;;
3453 *.lo |
*.
$objext) linkmode
=obj
;;
3454 *.la
) linkmode
=lib
;;
3455 *) linkmode
=prog
;; # Anything else should be a program.
3461 # Find all interdependent deplibs by searching for libraries
3462 # that are linked more than once (e.g. -la -lb -la)
3463 for deplib
in $deplibs; do
3464 if $opt_duplicate_deps ; then
3466 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
3469 libs
="$libs $deplib"
3472 if test "$linkmode" = lib
; then
3473 libs
="$predeps $libs $compiler_lib_search_path $postdeps"
3475 # Compute libraries that are listed more than once in $predeps
3476 # $postdeps and mark them as special (i.e., whose duplicates are
3477 # not to be eliminated).
3479 if $opt_duplicate_compiler_generated_deps; then
3480 for pre_post_dep
in $predeps $postdeps; do
3481 case "$pre_post_deps " in
3482 *" $pre_post_dep "*) specialdeplibs
="$specialdeplibs $pre_post_deps" ;;
3484 pre_post_deps
="$pre_post_deps $pre_post_dep"
3493 need_relink
=no
# whether we're linking any uninstalled libtool libraries
3494 notinst_deplibs
= # not-installed libtool libraries
3495 notinst_path
= # paths that contain not-installed libtool libraries
3499 passes
="conv dlpreopen link"
3500 for file in $dlfiles $dlprefiles; do
3504 func_fatal_help
"libraries can \`-dlopen' only libtool libraries: $file"
3515 passes
="conv scan dlopen dlpreopen link"
3521 for pass
in $passes; do
3522 # The preopen pass in lib mode reverses $deplibs; put it back here
3523 # so that -L comes before libs that need it for instance...
3524 if test "$linkmode,$pass" = "lib,link"; then
3525 ## FIXME: Find the place where the list is rebuilt in the wrong
3526 ## order, and fix it there properly
3528 for deplib
in $deplibs; do
3529 tmp_deplibs
="$deplib $tmp_deplibs"
3531 deplibs
="$tmp_deplibs"
3534 if test "$linkmode,$pass" = "lib,link" ||
3535 test "$linkmode,$pass" = "prog,scan"; then
3539 if test "$linkmode" = prog
; then
3541 dlopen
) libs
="$dlfiles" ;;
3542 dlpreopen
) libs
="$dlprefiles" ;;
3543 link
) libs
="$deplibs %DEPLIBS% $dependency_libs" ;;
3546 if test "$linkmode,$pass" = "lib,dlpreopen"; then
3547 # Collect and forward deplibs of preopened libtool libs
3548 for lib
in $dlprefiles; do
3549 # Ignore non-libtool-libs
3552 *.la
) func_source
"$lib" ;;
3555 # Collect preopened libtool deplibs, except any this library
3556 # has declared as weak libs
3557 for deplib
in $dependency_libs; do
3558 deplib_base
=`$ECHO "X$deplib" | $Xsed -e "$basename"`
3559 case " $weak_libs " in
3560 *" $deplib_base "*) ;;
3561 *) deplibs
="$deplibs $deplib" ;;
3567 if test "$pass" = dlopen
; then
3568 # Collect dlpreopened libraries
3569 save_deplibs
="$deplibs"
3573 for deplib
in $libs; do
3577 -mt|
-mthreads|
-kthread|
-Kthread|
-pthread|
-pthreads|
--thread-safe|
-threads)
3578 if test "$linkmode,$pass" = "prog,link"; then
3579 compile_deplibs
="$deplib $compile_deplibs"
3580 finalize_deplibs
="$deplib $finalize_deplibs"
3582 compiler_flags
="$compiler_flags $deplib"
3583 if test "$linkmode" = lib
; then
3584 case "$new_inherited_linker_flags " in
3586 * ) new_inherited_linker_flags
="$new_inherited_linker_flags $deplib" ;;
3593 if test "$linkmode" != lib
&& test "$linkmode" != prog
; then
3594 func_warning
"\`-l' is ignored for archives/objects"
3597 func_stripname
'-l' '' "$deplib"
3598 name
=$func_stripname_result
3599 for searchdir
in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
3600 for search_ext
in .la
$std_shrext .so .a
; do
3601 # Search the libtool library
3602 lib
="$searchdir/lib${name}${search_ext}"
3603 if test -f "$lib"; then
3604 if test "$search_ext" = ".la"; then
3613 if test "$found" != yes; then
3614 # deplib doesn't seem to be a libtool library
3615 if test "$linkmode,$pass" = "prog,link"; then
3616 compile_deplibs
="$deplib $compile_deplibs"
3617 finalize_deplibs
="$deplib $finalize_deplibs"
3619 deplibs
="$deplib $deplibs"
3620 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
3623 else # deplib is a libtool library
3624 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
3625 # We need to do some special things here, and not later.
3626 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3627 case " $predeps $postdeps " in
3629 if func_lalib_p
"$lib"; then
3633 for l
in $old_library $library_names; do
3636 if test "X$ll" = "X$old_library" ; then # only static version available
3638 func_dirname
"$lib" "" "."
3639 ladir
="$func_dirname_result"
3640 lib
=$ladir/$old_library
3641 if test "$linkmode,$pass" = "prog,link"; then
3642 compile_deplibs
="$deplib $compile_deplibs"
3643 finalize_deplibs
="$deplib $finalize_deplibs"
3645 deplibs
="$deplib $deplibs"
3646 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
3658 if test "$linkmode,$pass" = "prog,link"; then
3659 compile_deplibs
="$deplib $compile_deplibs"
3660 finalize_deplibs
="$deplib $finalize_deplibs"
3662 deplibs
="$deplib $deplibs"
3663 if test "$linkmode" = lib
; then
3664 case "$new_inherited_linker_flags " in
3666 * ) new_inherited_linker_flags
="$new_inherited_linker_flags $deplib" ;;
3675 deplibs
="$deplib $deplibs"
3676 test "$pass" = conv
&& continue
3677 newdependency_libs
="$deplib $newdependency_libs"
3678 func_stripname
'-L' '' "$deplib"
3679 newlib_search_path
="$newlib_search_path $func_stripname_result"
3682 if test "$pass" = conv
; then
3683 deplibs
="$deplib $deplibs"
3686 if test "$pass" = scan
; then
3687 deplibs
="$deplib $deplibs"
3689 compile_deplibs
="$deplib $compile_deplibs"
3690 finalize_deplibs
="$deplib $finalize_deplibs"
3692 func_stripname
'-L' '' "$deplib"
3693 newlib_search_path
="$newlib_search_path $func_stripname_result"
3696 func_warning
"\`-L' is ignored for archives/objects"
3702 if test "$pass" = link
; then
3703 func_stripname
'-R' '' "$deplib"
3704 dir
=$func_stripname_result
3705 # Make sure the xrpath contains only unique directories.
3708 *) xrpath
="$xrpath $dir" ;;
3711 deplibs
="$deplib $deplibs"
3714 *.la
) lib
="$deplib" ;;
3716 if test "$pass" = conv
; then
3717 deplibs
="$deplib $deplibs"
3722 # Linking convenience modules into shared libraries is allowed,
3723 # but linking other static libraries is non-portable.
3724 case " $dlpreconveniencelibs " in
3728 case $deplibs_check_method in
3730 set dummy
$deplibs_check_method; shift
3731 match_pattern_regex
=`expr "$deplibs_check_method" : "$1 \(.*\)"`
3732 if eval "\$ECHO \"X$deplib\"" 2>/dev
/null |
$Xsed -e 10q \
3733 |
$EGREP "$match_pattern_regex" > /dev
/null
; then
3741 if test "$valid_a_lib" != yes; then
3743 $ECHO "*** Warning: Trying to link with static lib archive $deplib."
3744 $ECHO "*** I have the capability to make that library automatically link in when"
3745 $ECHO "*** you link to this library. But I can only do this if you have a"
3746 $ECHO "*** shared version of the library, which you do not appear to have"
3747 $ECHO "*** because the file extensions .$libext of this argument makes me believe"
3748 $ECHO "*** that it is just a static archive that I should not use here."
3751 $ECHO "*** Warning: Linking the shared library $output against the"
3752 $ECHO "*** static library $deplib is not portable!"
3753 deplibs
="$deplib $deplibs"
3760 if test "$pass" != link
; then
3761 deplibs
="$deplib $deplibs"
3763 compile_deplibs
="$deplib $compile_deplibs"
3764 finalize_deplibs
="$deplib $finalize_deplibs"
3771 if test "$pass" = conv
; then
3772 deplibs
="$deplib $deplibs"
3773 elif test "$linkmode" = prog
; then
3774 if test "$pass" = dlpreopen ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
3775 # If there is no dlopen support or we're linking statically,
3776 # we need to preload.
3777 newdlprefiles
="$newdlprefiles $deplib"
3778 compile_deplibs
="$deplib $compile_deplibs"
3779 finalize_deplibs
="$deplib $finalize_deplibs"
3781 newdlfiles
="$newdlfiles $deplib"
3792 if test "$found" = yes ||
test -f "$lib"; then :
3794 func_fatal_error
"cannot find the library \`$lib' or unhandled argument \`$deplib'"
3797 # Check to see that this really is a libtool archive.
3798 func_lalib_unsafe_p
"$lib" \
3799 || func_fatal_error
"\`$lib' is not a valid libtool archive"
3801 func_dirname
"$lib" "" "."
3802 ladir
="$func_dirname_result"
3810 inherited_linker_flags
=
3811 # If the library was installed with an old release of libtool,
3812 # it will not redefine variables installed, or shouldnotlink
3821 # Convert "-framework foo" to "foo.ltframework"
3822 if test -n "$inherited_linker_flags"; then
3823 tmp_inherited_linker_flags
=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
3824 for tmp_inherited_linker_flag
in $tmp_inherited_linker_flags; do
3825 case " $new_inherited_linker_flags " in
3826 *" $tmp_inherited_linker_flag "*) ;;
3827 *) new_inherited_linker_flags
="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
3831 dependency_libs
=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
3832 if test "$linkmode,$pass" = "prog,link"; then
3833 compile_deplibs
="$new_inherited_linker_flags $compile_deplibs"
3834 finalize_deplibs
="$new_inherited_linker_flags $finalize_deplibs"
3836 compiler_flags
="$compiler_flags $inherited_linker_flags"
3838 if test "$linkmode,$pass" = "lib,link" ||
3839 test "$linkmode,$pass" = "prog,scan" ||
3840 { test "$linkmode" != prog
&& test "$linkmode" != lib
; }; then
3841 test -n "$dlopen" && dlfiles
="$dlfiles $dlopen"
3842 test -n "$dlpreopen" && dlprefiles
="$dlprefiles $dlpreopen"
3845 if test "$pass" = conv
; then
3846 # Only check for convenience libraries
3847 deplibs
="$lib $deplibs"
3848 if test -z "$libdir"; then
3849 if test -z "$old_library"; then
3850 func_fatal_error
"cannot find name of link library for \`$lib'"
3852 # It is a libtool convenience library, so add in its objects.
3853 convenience
="$convenience $ladir/$objdir/$old_library"
3854 old_convenience
="$old_convenience $ladir/$objdir/$old_library"
3855 elif test "$linkmode" != prog
&& test "$linkmode" != lib
; then
3856 func_fatal_error
"\`$lib' is not a convenience library"
3859 for deplib
in $dependency_libs; do
3860 deplibs
="$deplib $deplibs"
3861 if $opt_duplicate_deps ; then
3862 case "$tmp_libs " in
3863 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
3866 tmp_libs
="$tmp_libs $deplib"
3872 # Get the name of the library we link against.
3874 for l
in $old_library $library_names; do
3877 if test -z "$linklib"; then
3878 func_fatal_error
"cannot find name of link library for \`$lib'"
3881 # This library was specified with -dlopen.
3882 if test "$pass" = dlopen
; then
3883 if test -z "$libdir"; then
3884 func_fatal_error
"cannot -dlopen a convenience library: \`$lib'"
3886 if test -z "$dlname" ||
3887 test "$dlopen_support" != yes ||
3888 test "$build_libtool_libs" = no
; then
3889 # If there is no dlname, no dlopen support or we're linking
3890 # statically, we need to preload. We also need to preload any
3891 # dependent libraries so libltdl's deplib preloader doesn't
3892 # bomb out in the load deplibs phase.
3893 dlprefiles
="$dlprefiles $lib $dependency_libs"
3895 newdlfiles
="$newdlfiles $lib"
3900 # We need an absolute path.
3902 [\\/]* |
[A-Za-z
]:[\\/]*) abs_ladir
="$ladir" ;;
3904 abs_ladir
=`cd "$ladir" && pwd`
3905 if test -z "$abs_ladir"; then
3906 func_warning
"cannot determine absolute directory name of \`$ladir'"
3907 func_warning
"passing it literally to the linker, although it might fail"
3912 func_basename
"$lib"
3913 laname
="$func_basename_result"
3915 # Find the relevant object directory and library name.
3916 if test "X$installed" = Xyes
; then
3917 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
3918 func_warning
"library \`$lib' was moved."
3926 test "X$hardcode_automatic" = Xyes
&& avoidtemprpath
=yes
3928 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
3931 # Remove this search path later
3932 notinst_path
="$notinst_path $abs_ladir"
3934 dir
="$ladir/$objdir"
3935 absdir
="$abs_ladir/$objdir"
3936 # Remove this search path later
3937 notinst_path
="$notinst_path $abs_ladir"
3939 fi # $installed = yes
3940 func_stripname
'lib' '.la' "$laname"
3941 name
=$func_stripname_result
3943 # This library was specified with -dlpreopen.
3944 if test "$pass" = dlpreopen
; then
3945 if test -z "$libdir" && test "$linkmode" = prog
; then
3946 func_fatal_error
"only libraries may -dlpreopen a convenience library: \`$lib'"
3948 # Prefer using a static library (so that no silly _DYNAMIC symbols
3949 # are required to link).
3950 if test -n "$old_library"; then
3951 newdlprefiles
="$newdlprefiles $dir/$old_library"
3952 # Keep a list of preopened convenience libraries to check
3953 # that they are being used correctly in the link pass.
3954 test -z "$libdir" && \
3955 dlpreconveniencelibs
="$dlpreconveniencelibs $dir/$old_library"
3956 # Otherwise, use the dlname, so that lt_dlopen finds it.
3957 elif test -n "$dlname"; then
3958 newdlprefiles
="$newdlprefiles $dir/$dlname"
3960 newdlprefiles
="$newdlprefiles $dir/$linklib"
3962 fi # $pass = dlpreopen
3964 if test -z "$libdir"; then
3965 # Link the convenience library
3966 if test "$linkmode" = lib
; then
3967 deplibs
="$dir/$old_library $deplibs"
3968 elif test "$linkmode,$pass" = "prog,link"; then
3969 compile_deplibs
="$dir/$old_library $compile_deplibs"
3970 finalize_deplibs
="$dir/$old_library $finalize_deplibs"
3972 deplibs
="$lib $deplibs" # used for prog,scan pass
3978 if test "$linkmode" = prog
&& test "$pass" != link
; then
3979 newlib_search_path
="$newlib_search_path $ladir"
3980 deplibs
="$lib $deplibs"
3983 if test "$link_all_deplibs" != no ||
test -z "$library_names" ||
3984 test "$build_libtool_libs" = no
; then
3989 for deplib
in $dependency_libs; do
3991 -L*) func_stripname
'-L' '' "$deplib"
3992 newlib_search_path
="$newlib_search_path $func_stripname_result"
3995 # Need to link against all dependency_libs?
3996 if test "$linkalldeplibs" = yes; then
3997 deplibs
="$deplib $deplibs"
3999 # Need to hardcode shared library paths
4000 # or/and link against static libraries
4001 newdependency_libs
="$deplib $newdependency_libs"
4003 if $opt_duplicate_deps ; then
4004 case "$tmp_libs " in
4005 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
4008 tmp_libs
="$tmp_libs $deplib"
4011 fi # $linkmode = prog...
4013 if test "$linkmode,$pass" = "prog,link"; then
4014 if test -n "$library_names" &&
4015 { { test "$prefer_static_libs" = no ||
4016 test "$prefer_static_libs,$installed" = "built,yes"; } ||
4017 test -z "$old_library"; }; then
4018 # We need to hardcode the library path
4019 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
4020 # Make sure the rpath contains only unique directories.
4021 case "$temp_rpath:" in
4023 *) temp_rpath
="$temp_rpath$absdir:" ;;
4027 # Hardcode the library path.
4028 # Skip directories that are in the system default run-time
4030 case " $sys_lib_dlsearch_path " in
4033 case "$compile_rpath " in
4035 *) compile_rpath
="$compile_rpath $absdir"
4039 case " $sys_lib_dlsearch_path " in
4042 case "$finalize_rpath " in
4044 *) finalize_rpath
="$finalize_rpath $libdir"
4048 fi # $linkmode,$pass = prog,link...
4050 if test "$alldeplibs" = yes &&
4051 { test "$deplibs_check_method" = pass_all ||
4052 { test "$build_libtool_libs" = yes &&
4053 test -n "$library_names"; }; }; then
4054 # We only need to search for static libraries
4059 link_static
=no
# Whether the deplib will be linked statically
4060 use_static_libs
=$prefer_static_libs
4061 if test "$use_static_libs" = built
&& test "$installed" = yes; then
4064 if test -n "$library_names" &&
4065 { test "$use_static_libs" = no ||
test -z "$old_library"; }; then
4068 # No point in relinking DLLs because paths are not encoded
4069 notinst_deplibs
="$notinst_deplibs $lib"
4073 if test "$installed" = no
; then
4074 notinst_deplibs
="$notinst_deplibs $lib"
4079 # This is a shared library
4081 # Warn about portability, can't link against -module's on some
4082 # systems (darwin). Don't bleat about dlopened modules though!
4084 for dlpremoduletest
in $dlprefiles; do
4085 if test "X$dlpremoduletest" = "X$lib"; then
4086 dlopenmodule
="$dlpremoduletest"
4090 if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link
; then
4092 if test "$linkmode" = prog
; then
4093 $ECHO "*** Warning: Linking the executable $output against the loadable module"
4095 $ECHO "*** Warning: Linking the shared library $output against the loadable module"
4097 $ECHO "*** $linklib is not portable!"
4099 if test "$linkmode" = lib
&&
4100 test "$hardcode_into_libs" = yes; then
4101 # Hardcode the library path.
4102 # Skip directories that are in the system default run-time
4104 case " $sys_lib_dlsearch_path " in
4107 case "$compile_rpath " in
4109 *) compile_rpath
="$compile_rpath $absdir"
4113 case " $sys_lib_dlsearch_path " in
4116 case "$finalize_rpath " in
4118 *) finalize_rpath
="$finalize_rpath $libdir"
4124 if test -n "$old_archive_from_expsyms_cmds"; then
4125 # figure out the soname
4126 set dummy
$library_names
4130 libname
=`eval "\\$ECHO \"$libname_spec\""`
4131 # use dlname if we got it. it's perfectly good, no?
4132 if test -n "$dlname"; then
4134 elif test -n "$soname_spec"; then
4138 major
=`expr $current - $age`
4142 eval soname
=\"$soname_spec\"
4147 # Make a new name for the extract_expsyms_cmds to use
4149 func_basename
"$soroot"
4150 soname
="$func_basename_result"
4151 func_stripname
'lib' '.dll' "$soname"
4152 newlib
=libimp-
$func_stripname_result.a
4154 # If the library has no export list, then create one now
4155 if test -f "$output_objdir/$soname-def"; then :
4157 func_echo
"extracting exported symbol list from \`$soname'"
4158 func_execute_cmds
"$extract_expsyms_cmds" 'exit $?'
4162 if test -f "$output_objdir/$newlib"; then :; else
4163 func_echo
"generating import library for \`$soname'"
4164 func_execute_cmds
"$old_archive_from_expsyms_cmds" 'exit $?'
4166 # make sure the library variables are pointing to the new library
4169 fi # test -n "$old_archive_from_expsyms_cmds"
4171 if test "$linkmode" = prog ||
test "$mode" != relink
; then
4176 case $hardcode_action in
4177 immediate | unsupported
)
4178 if test "$hardcode_direct" = no
; then
4181 *-*-sco3.2v5.0.
[024]*) add_dir
="-L$dir" ;;
4182 *-*-sysv4*uw2
*) add_dir
="-L$dir" ;;
4183 *-*-sysv5OpenUNIX* |
*-*-sysv5UnixWare7.
[01].
[10]* | \
4184 *-*-unixware7*) add_dir
="-L$dir" ;;
4186 # if the lib is a (non-dlopened) module then we can not
4187 # link against it, someone is ignoring the earlier warnings
4188 if /usr
/bin
/file -L $add 2> /dev
/null |
4189 $GREP ": [^:]* bundle" >/dev
/null
; then
4190 if test "X$dlopenmodule" != "X$lib"; then
4191 $ECHO "*** Warning: lib $linklib is a module, not a shared library"
4192 if test -z "$old_library" ; then
4194 $ECHO "*** And there doesn't seem to be a static archive available"
4195 $ECHO "*** The link will probably fail, sorry"
4197 add
="$dir/$old_library"
4199 elif test -n "$old_library"; then
4200 add
="$dir/$old_library"
4204 elif test "$hardcode_minus_L" = no
; then
4206 *-*-sunos*) add_shlibpath
="$dir" ;;
4210 elif test "$hardcode_shlibpath_var" = no
; then
4211 add_shlibpath
="$dir"
4218 if test "$hardcode_direct" = yes &&
4219 test "$hardcode_direct_absolute" = no
; then
4221 elif test "$hardcode_minus_L" = yes; then
4223 # Try looking first in the location we're being installed to.
4224 if test -n "$inst_prefix_dir"; then
4227 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
4232 elif test "$hardcode_shlibpath_var" = yes; then
4233 add_shlibpath
="$dir"
4242 if test "$lib_linked" != yes; then
4243 func_fatal_configuration
"unsupported hardcode properties"
4246 if test -n "$add_shlibpath"; then
4247 case :$compile_shlibpath: in
4248 *":$add_shlibpath:"*) ;;
4249 *) compile_shlibpath
="$compile_shlibpath$add_shlibpath:" ;;
4252 if test "$linkmode" = prog
; then
4253 test -n "$add_dir" && compile_deplibs
="$add_dir $compile_deplibs"
4254 test -n "$add" && compile_deplibs
="$add $compile_deplibs"
4256 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
4257 test -n "$add" && deplibs
="$add $deplibs"
4258 if test "$hardcode_direct" != yes &&
4259 test "$hardcode_minus_L" != yes &&
4260 test "$hardcode_shlibpath_var" = yes; then
4261 case :$finalize_shlibpath: in
4263 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
4269 if test "$linkmode" = prog ||
test "$mode" = relink
; then
4273 # Finalize command for both is simple: just hardcode it.
4274 if test "$hardcode_direct" = yes &&
4275 test "$hardcode_direct_absolute" = no
; then
4276 add
="$libdir/$linklib"
4277 elif test "$hardcode_minus_L" = yes; then
4280 elif test "$hardcode_shlibpath_var" = yes; then
4281 case :$finalize_shlibpath: in
4283 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
4286 elif test "$hardcode_automatic" = yes; then
4287 if test -n "$inst_prefix_dir" &&
4288 test -f "$inst_prefix_dir$libdir/$linklib" ; then
4289 add
="$inst_prefix_dir$libdir/$linklib"
4291 add
="$libdir/$linklib"
4294 # We cannot seem to hardcode it, guess we'll fake it.
4296 # Try looking first in the location we're being installed to.
4297 if test -n "$inst_prefix_dir"; then
4300 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
4307 if test "$linkmode" = prog
; then
4308 test -n "$add_dir" && finalize_deplibs
="$add_dir $finalize_deplibs"
4309 test -n "$add" && finalize_deplibs
="$add $finalize_deplibs"
4311 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
4312 test -n "$add" && deplibs
="$add $deplibs"
4315 elif test "$linkmode" = prog
; then
4316 # Here we assume that one of hardcode_direct or hardcode_minus_L
4317 # is not unsupported. This is valid on all known static and
4319 if test "$hardcode_direct" != unsupported
; then
4320 test -n "$old_library" && linklib
="$old_library"
4321 compile_deplibs
="$dir/$linklib $compile_deplibs"
4322 finalize_deplibs
="$dir/$linklib $finalize_deplibs"
4324 compile_deplibs
="-l$name -L$dir $compile_deplibs"
4325 finalize_deplibs
="-l$name -L$dir $finalize_deplibs"
4327 elif test "$build_libtool_libs" = yes; then
4328 # Not a shared library
4329 if test "$deplibs_check_method" != pass_all
; then
4330 # We're trying link a shared library against a static one
4331 # but the system doesn't support it.
4333 # Just print a warning and add the library to dependency_libs so
4334 # that the program can be linked against the static library.
4336 $ECHO "*** Warning: This system can not link to static lib archive $lib."
4337 $ECHO "*** I have the capability to make that library automatically link in when"
4338 $ECHO "*** you link to this library. But I can only do this if you have a"
4339 $ECHO "*** shared version of the library, which you do not appear to have."
4340 if test "$module" = yes; then
4341 $ECHO "*** But as you try to build a module library, libtool will still create "
4342 $ECHO "*** a static module, that should work as long as the dlopening application"
4343 $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
4344 if test -z "$global_symbol_pipe"; then
4346 $ECHO "*** However, this would only work if libtool was able to extract symbol"
4347 $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
4348 $ECHO "*** not find such a program. So, this module is probably useless."
4349 $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
4351 if test "$build_old_libs" = no
; then
4352 build_libtool_libs
=module
4355 build_libtool_libs
=no
4359 deplibs
="$dir/$old_library $deplibs"
4362 fi # link shared/static library?
4364 if test "$linkmode" = lib
; then
4365 if test -n "$dependency_libs" &&
4366 { test "$hardcode_into_libs" != yes ||
4367 test "$build_old_libs" = yes ||
4368 test "$link_static" = yes; }; then
4369 # Extract -R from dependency_libs
4371 for libdir
in $dependency_libs; do
4373 -R*) func_stripname
'-R' '' "$libdir"
4374 temp_xrpath
=$func_stripname_result
4376 *" $temp_xrpath "*) ;;
4377 *) xrpath
="$xrpath $temp_xrpath";;
4379 *) temp_deplibs
="$temp_deplibs $libdir";;
4382 dependency_libs
="$temp_deplibs"
4385 newlib_search_path
="$newlib_search_path $absdir"
4386 # Link against this library
4387 test "$link_static" = no
&& newdependency_libs
="$abs_ladir/$laname $newdependency_libs"
4388 # ... and its dependency_libs
4390 for deplib
in $dependency_libs; do
4391 newdependency_libs
="$deplib $newdependency_libs"
4392 if $opt_duplicate_deps ; then
4393 case "$tmp_libs " in
4394 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
4397 tmp_libs
="$tmp_libs $deplib"
4400 if test "$link_all_deplibs" != no
; then
4401 # Add the search paths of all dependency libraries
4402 for deplib
in $dependency_libs; do
4404 -L*) path
="$deplib" ;;
4406 func_dirname
"$deplib" "" "."
4407 dir
="$func_dirname_result"
4408 # We need an absolute path.
4410 [\\/]* |
[A-Za-z
]:[\\/]*) absdir
="$dir" ;;
4412 absdir
=`cd "$dir" && pwd`
4413 if test -z "$absdir"; then
4414 func_warning
"cannot determine absolute directory name of \`$dir'"
4419 if $GREP "^installed=no" $deplib > /dev
/null
; then
4423 eval deplibrary_names
=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
4424 if test -n "$deplibrary_names" ; then
4425 for tmp
in $deplibrary_names ; do
4428 if test -f "$absdir/$objdir/$depdepl" ; then
4429 depdepl
="$absdir/$objdir/$depdepl"
4430 darwin_install_name
=`otool -L $depdepl | $SED -n -e '3q;2,2p' | $SED -e 's/(.*//'`
4431 darwin_install_name
=`$ECHO $darwin_install_name`
4432 compiler_flags
="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
4433 linker_flags
="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
4439 path
="-L$absdir/$objdir"
4443 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
4444 test -z "$libdir" && \
4445 func_fatal_error
"\`$deplib' is not a valid libtool archive"
4446 test "$absdir" != "$libdir" && \
4447 func_warning
"\`$deplib' seems to be moved"
4453 case " $deplibs " in
4455 *) deplibs
="$path $deplibs" ;;
4458 fi # link_all_deplibs != no
4460 done # for deplib in $libs
4461 dependency_libs
="$newdependency_libs"
4462 if test "$pass" = dlpreopen
; then
4463 # Link the dlpreopened libraries before other libraries
4464 for deplib
in $save_deplibs; do
4465 deplibs
="$deplib $deplibs"
4468 if test "$pass" != dlopen
; then
4469 if test "$pass" != conv
; then
4470 # Make sure lib_search_path contains only unique directories.
4472 for dir
in $newlib_search_path; do
4473 case "$lib_search_path " in
4475 *) lib_search_path
="$lib_search_path $dir" ;;
4481 if test "$linkmode,$pass" != "prog,link"; then
4484 vars
="compile_deplibs finalize_deplibs"
4486 for var
in $vars dependency_libs
; do
4487 # Add libraries to $var in reverse order
4488 eval tmp_libs
=\"\$
$var\"
4490 for deplib
in $tmp_libs; do
4491 # FIXME: Pedantically, this is the right thing to do, so
4492 # that some nasty dependency loop isn't accidentally
4494 #new_libs="$deplib $new_libs"
4495 # Pragmatically, this seems to cause very few problems in
4498 -L*) new_libs
="$deplib $new_libs" ;;
4501 # And here is the reason: when a library appears more
4502 # than once as an explicit dependence of a library, or
4503 # is implicitly linked in more than once by the
4504 # compiler, it is considered special, and multiple
4505 # occurrences thereof are not removed. Compare this
4506 # with having the same library being listed as a
4507 # dependency of multiple other libraries: in this case,
4508 # we know (pedantically, we assume) the library does not
4509 # need to be listed more than once, so we keep only the
4510 # last copy. This is not always right, but it is rare
4511 # enough that we require users that really mean to play
4512 # such unportable linking tricks to link the library
4513 # using -Wl,-lname, so that libtool does not consider it
4514 # for duplicate removal.
4515 case " $specialdeplibs " in
4516 *" $deplib "*) new_libs
="$deplib $new_libs" ;;
4518 case " $new_libs " in
4520 *) new_libs
="$deplib $new_libs" ;;
4528 for deplib
in $new_libs; do
4531 case " $tmp_libs " in
4533 *) tmp_libs
="$tmp_libs $deplib" ;;
4536 *) tmp_libs
="$tmp_libs $deplib" ;;
4539 eval $var=\"$tmp_libs\"
4542 # Last step: remove runtime libs from dependency_libs
4543 # (they stay in deplibs)
4545 for i
in $dependency_libs ; do
4546 case " $predeps $postdeps $compiler_lib_search_path " in
4551 if test -n "$i" ; then
4552 tmp_libs
="$tmp_libs $i"
4555 dependency_libs
=$tmp_libs
4557 if test "$linkmode" = prog
; then
4558 dlfiles
="$newdlfiles"
4560 if test "$linkmode" = prog ||
test "$linkmode" = lib
; then
4561 dlprefiles
="$newdlprefiles"
4566 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
4567 func_warning
"\`-dlopen' is ignored for archives"
4570 test -n "$deplibs" && \
4571 func_warning
"\`-l' and \`-L' are ignored for archives"
4574 test -n "$rpath" && \
4575 func_warning
"\`-rpath' is ignored for archives"
4577 test -n "$xrpath" && \
4578 func_warning
"\`-R' is ignored for archives"
4580 test -n "$vinfo" && \
4581 func_warning
"\`-version-info/-version-number' is ignored for archives"
4583 test -n "$release" && \
4584 func_warning
"\`-release' is ignored for archives"
4586 test -n "$export_symbols$export_symbols_regex" && \
4587 func_warning
"\`-export-symbols' is ignored for archives"
4589 # Now set the variables for building old libraries.
4590 build_libtool_libs
=no
4592 objs
="$objs$old_deplibs"
4596 # Make sure we only generate libraries of the form `libNAME.la'.
4599 func_stripname
'lib' '.la' "$outputname"
4600 name
=$func_stripname_result
4601 eval shared_ext
=\"$shrext_cmds\"
4602 eval libname
=\"$libname_spec\"
4605 test "$module" = no
&& \
4606 func_fatal_help
"libtool library \`$output' must begin with \`lib'"
4608 if test "$need_lib_prefix" != no
; then
4609 # Add the "lib" prefix for modules if required
4610 func_stripname
'' '.la' "$outputname"
4611 name
=$func_stripname_result
4612 eval shared_ext
=\"$shrext_cmds\"
4613 eval libname
=\"$libname_spec\"
4615 func_stripname
'' '.la' "$outputname"
4616 libname
=$func_stripname_result
4621 if test -n "$objs"; then
4622 if test "$deplibs_check_method" != pass_all
; then
4623 func_fatal_error
"cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
4626 $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
4627 $ECHO "*** objects $objs is not portable!"
4628 libobjs
="$libobjs $objs"
4632 test "$dlself" != no
&& \
4633 func_warning
"\`-dlopen self' is ignored for libtool libraries"
4637 test "$#" -gt 1 && \
4638 func_warning
"ignoring multiple \`-rpath's for a libtool library"
4643 if test -z "$rpath"; then
4644 if test "$build_libtool_libs" = yes; then
4645 # Building a libtool convenience library.
4646 # Some compilers have problems with a `.al' extension so
4647 # convenience libraries should have the same extension an
4648 # archive normally would.
4649 oldlibs
="$output_objdir/$libname.$libext $oldlibs"
4650 build_libtool_libs
=convenience
4654 test -n "$vinfo" && \
4655 func_warning
"\`-version-info/-version-number' is ignored for convenience libraries"
4657 test -n "$release" && \
4658 func_warning
"\`-release' is ignored for convenience libraries"
4661 # Parse the version information argument.
4662 save_ifs
="$IFS"; IFS
=':'
4663 set dummy
$vinfo 0 0 0
4668 func_fatal_help
"too many parameters to \`-version-info'"
4670 # convert absolute version numbers to libtool ages
4671 # this retains compatibility with .la files and attempts
4672 # to make the code below a bit more comprehensible
4674 case $vinfo_number in
4678 number_revision
="$3"
4680 # There are really only two kinds -- those that
4681 # use the current revision as the major version
4682 # and those that subtract age and use age as
4683 # a minor version. But, then there is irix
4684 # which has an extra 1 added just for fun
4686 case $version_type in
4687 darwin|linux|osf|windows|none
)
4688 current
=`expr $number_major + $number_minor`
4690 revision
="$number_revision"
4692 freebsd-aout|freebsd-elf|sunos
)
4693 current
="$number_major"
4694 revision
="$number_minor"
4698 current
=`expr $number_major + $number_minor - 1`
4700 revision
="$number_minor"
4711 # Check that each of the things are valid numbers.
4713 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]) ;;
4715 func_error
"CURRENT \`$current' must be a nonnegative integer"
4716 func_fatal_error
"\`$vinfo' is not valid version information"
4721 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]) ;;
4723 func_error
"REVISION \`$revision' must be a nonnegative integer"
4724 func_fatal_error
"\`$vinfo' is not valid version information"
4729 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]) ;;
4731 func_error
"AGE \`$age' must be a nonnegative integer"
4732 func_fatal_error
"\`$vinfo' is not valid version information"
4736 if test "$age" -gt "$current"; then
4737 func_error
"AGE \`$age' is greater than the current interface number \`$current'"
4738 func_fatal_error
"\`$vinfo' is not valid version information"
4741 # Calculate the version variables.
4745 case $version_type in
4749 # Like Linux, but with the current version available in
4750 # verstring for coding it into the library header
4751 major
=.
`expr $current - $age`
4752 versuffix
="$major.$age.$revision"
4753 # Darwin ld doesn't like 0 for these options...
4754 minor_current
=`expr $current + 1`
4755 verstring
="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
4760 versuffix
=".$current.$revision";
4765 versuffix
=".$current"
4769 major
=`expr $current - $age + 1`
4771 case $version_type in
4772 nonstopux
) verstring_prefix
=nonstopux
;;
4773 *) verstring_prefix
=sgi
;;
4775 verstring
="$verstring_prefix$major.$revision"
4777 # Add in all the interfaces that we are compatible with.
4779 while test "$loop" -ne 0; do
4780 iface
=`expr $revision - $loop`
4781 loop
=`expr $loop - 1`
4782 verstring
="$verstring_prefix$major.$iface:$verstring"
4785 # Before this point, $major must not contain `.'.
4787 versuffix
="$major.$revision"
4791 major
=.
`expr $current - $age`
4792 versuffix
="$major.$age.$revision"
4796 major
=.
`expr $current - $age`
4797 versuffix
=".$current.$age.$revision"
4798 verstring
="$current.$age.$revision"
4800 # Add in all the interfaces that we are compatible with.
4802 while test "$loop" -ne 0; do
4803 iface
=`expr $current - $loop`
4804 loop
=`expr $loop - 1`
4805 verstring
="$verstring:${iface}.0"
4808 # Make executables depend on our current version.
4809 verstring
="$verstring:${current}.0"
4814 versuffix
=".$current"
4819 versuffix
=".$current.$revision"
4823 # Use '-' rather than '.', since we only want one
4824 # extension on DOS 8.3 filesystems.
4825 major
=`expr $current - $age`
4830 func_fatal_configuration
"unknown library version type \`$version_type'"
4834 # Clear the version info if we defaulted, and they specified a release.
4835 if test -z "$vinfo" && test -n "$release"; then
4837 case $version_type in
4839 # we can't check for "0.0" in archive_cmds due to quoting
4840 # problems, so we reset it completely
4847 if test "$need_version" = no
; then
4854 # Remove version info from name if versioning should be avoided
4855 if test "$avoid_version" = yes && test "$need_version" = no
; then
4861 # Check to see if the archive will have undefined symbols.
4862 if test "$allow_undefined" = yes; then
4863 if test "$allow_undefined_flag" = unsupported
; then
4864 func_warning
"undefined symbols not allowed in $host shared libraries"
4865 build_libtool_libs
=no
4869 # Don't allow undefined symbols.
4870 allow_undefined_flag
="$no_undefined_flag"
4875 func_generate_dlsyms
"$libname" "$libname" "yes"
4876 libobjs
="$libobjs $symfileobj"
4878 if test "$mode" != relink
; then
4879 # Remove our outputs, but don't remove object files since they
4880 # may have been created when compiling PIC objects.
4882 tempremovelist
=`$ECHO "$output_objdir/*"`
4883 for p
in $tempremovelist; do
4887 $output_objdir/$outputname |
$output_objdir/$libname.
* |
$output_objdir/${libname}${release}.
*)
4888 if test "X$precious_files_regex" != "X"; then
4889 if $ECHO "$p" |
$EGREP -e "$precious_files_regex" >/dev
/null
2>&1
4894 removelist
="$removelist $p"
4899 test -n "$removelist" && \
4900 func_show_eval
"${RM}r \$removelist"
4903 # Now set the variables for building old libraries.
4904 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience
; then
4905 oldlibs
="$oldlibs $output_objdir/$libname.$libext"
4907 # Transform .lo files to .o files.
4908 oldobjs
="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
4911 # Eliminate all temporary directories.
4912 #for path in $notinst_path; do
4913 # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
4914 # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
4915 # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
4918 if test -n "$xrpath"; then
4919 # If the user specified any rpath flags, then add them.
4921 for libdir
in $xrpath; do
4922 temp_xrpath
="$temp_xrpath -R$libdir"
4923 case "$finalize_rpath " in
4925 *) finalize_rpath
="$finalize_rpath $libdir" ;;
4928 if test "$hardcode_into_libs" != yes ||
test "$build_old_libs" = yes; then
4929 dependency_libs
="$temp_xrpath $dependency_libs"
4933 # Make sure dlfiles contains only unique files that won't be dlpreopened
4934 old_dlfiles
="$dlfiles"
4936 for lib
in $old_dlfiles; do
4937 case " $dlprefiles $dlfiles " in
4939 *) dlfiles
="$dlfiles $lib" ;;
4943 # Make sure dlprefiles contains only unique files
4944 old_dlprefiles
="$dlprefiles"
4946 for lib
in $old_dlprefiles; do
4947 case "$dlprefiles " in
4949 *) dlprefiles
="$dlprefiles $lib" ;;
4953 if test "$build_libtool_libs" = yes; then
4954 if test -n "$rpath"; then
4956 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2* |
*-*-beos*)
4957 # these systems don't actually have a c library (as such)!
4959 *-*-rhapsody* |
*-*-darwin1.
[012])
4960 # Rhapsody C library is in the System framework
4961 deplibs
="$deplibs System.ltframework"
4964 # Don't link with libc until the a.out ld.so is fixed.
4966 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
4967 # Do not include libc due to us having libc/libc_r.
4969 *-*-sco3.2v5
* |
*-*-sco5v6*)
4970 # Causes problems with __ctype
4972 *-*-sysv4.2uw2
* |
*-*-sysv5* |
*-*-unixware* |
*-*-OpenUNIX*)
4973 # Compiler inserts libc in the correct place for threads to work
4976 # Add libc to deplibs on all other systems if necessary.
4977 if test "$build_libtool_need_lc" = "yes"; then
4978 deplibs
="$deplibs -lc"
4984 # Transform deplibs into only deplibs that can be linked in shared.
4986 libname_save
=$libname
4987 release_save
=$release
4988 versuffix_save
=$versuffix
4990 # I'm not sure if I'm treating the release correctly. I think
4991 # release should show up in the -l (ie -lgmp5) so we don't want to
4992 # add it in twice. Is that correct?
4998 case $deplibs_check_method in
5000 # Don't check for shared/static. Everything works.
5001 # This might be a little naive. We might want to check
5002 # whether the library exists or not. But this is on
5003 # osf3 & osf4 and I'm not really sure... Just
5004 # implementing what was already the behavior.
5008 # This code stresses the "libraries are programs" paradigm to its
5009 # limits. Maybe even breaks it. We compile a program, linking it
5010 # against the deplibs as a proxy for the library. Then we can check
5011 # whether they linked in statically or dynamically with ldd.
5012 $opt_dry_run ||
$RM conftest.c
5013 cat > conftest.c
<<EOF
5014 int main() { return 0; }
5016 $opt_dry_run ||
$RM conftest
5017 if $LTCC $LTCFLAGS -o conftest conftest.c
$deplibs; then
5018 ldd_output
=`ldd conftest`
5019 for i
in $deplibs; do
5020 name
=`expr $i : '-l\(.*\)'`
5021 # If $name is empty we are operating on a -L argument.
5022 if test "$name" != "" && test "$name" != "0"; then
5023 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
5024 case " $predeps $postdeps " in
5026 newdeplibs
="$newdeplibs $i"
5031 if test -n "$i" ; then
5032 libname
=`eval "\\$ECHO \"$libname_spec\""`
5033 deplib_matches
=`eval "\\$ECHO \"$library_names_spec\""`
5034 set dummy
$deplib_matches; shift
5036 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
5037 newdeplibs
="$newdeplibs $i"
5041 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
5042 $ECHO "*** I have the capability to make that library automatically link in when"
5043 $ECHO "*** you link to this library. But I can only do this if you have a"
5044 $ECHO "*** shared version of the library, which I believe you do not have"
5045 $ECHO "*** because a test_compile did reveal that the linker did not use it for"
5046 $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
5050 newdeplibs
="$newdeplibs $i"
5054 # Error occurred in the first compile. Let's try to salvage
5055 # the situation: Compile a separate program for each library.
5056 for i
in $deplibs; do
5057 name
=`expr $i : '-l\(.*\)'`
5058 # If $name is empty we are operating on a -L argument.
5059 if test "$name" != "" && test "$name" != "0"; then
5060 $opt_dry_run ||
$RM conftest
5061 if $LTCC $LTCFLAGS -o conftest conftest.c
$i; then
5062 ldd_output
=`ldd conftest`
5063 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
5064 case " $predeps $postdeps " in
5066 newdeplibs
="$newdeplibs $i"
5071 if test -n "$i" ; then
5072 libname
=`eval "\\$ECHO \"$libname_spec\""`
5073 deplib_matches
=`eval "\\$ECHO \"$library_names_spec\""`
5074 set dummy
$deplib_matches; shift
5076 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
5077 newdeplibs
="$newdeplibs $i"
5081 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
5082 $ECHO "*** I have the capability to make that library automatically link in when"
5083 $ECHO "*** you link to this library. But I can only do this if you have a"
5084 $ECHO "*** shared version of the library, which you do not appear to have"
5085 $ECHO "*** because a test_compile did reveal that the linker did not use this one"
5086 $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
5092 $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
5093 $ECHO "*** make it link in! You will probably need to install it or some"
5094 $ECHO "*** library that it depends on before this library will be fully"
5095 $ECHO "*** functional. Installing it before continuing would be even better."
5098 newdeplibs
="$newdeplibs $i"
5104 set dummy
$deplibs_check_method; shift
5105 file_magic_regex
=`expr "$deplibs_check_method" : "$1 \(.*\)"`
5106 for a_deplib
in $deplibs; do
5107 name
=`expr $a_deplib : '-l\(.*\)'`
5108 # If $name is empty we are operating on a -L argument.
5109 if test "$name" != "" && test "$name" != "0"; then
5110 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
5111 case " $predeps $postdeps " in
5113 newdeplibs
="$newdeplibs $a_deplib"
5118 if test -n "$a_deplib" ; then
5119 libname
=`eval "\\$ECHO \"$libname_spec\""`
5120 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
5121 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
5122 for potent_lib
in $potential_libs; do
5123 # Follow soft links.
5124 if ls -lLd "$potent_lib" 2>/dev
/null |
5125 $GREP " -> " >/dev
/null
; then
5128 # The statement above tries to avoid entering an
5129 # endless loop below, in case of cyclic links.
5130 # We might still enter an endless loop, since a link
5131 # loop can be closed while we follow links,
5133 potlib
="$potent_lib"
5134 while test -h "$potlib" 2>/dev
/null
; do
5135 potliblink
=`ls -ld $potlib | ${SED} 's/.* -> //'`
5137 [\\/]* |
[A-Za-z
]:[\\/]*) potlib
="$potliblink";;
5138 *) potlib
=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
5141 if eval $file_magic_cmd \"\
$potlib\" 2>/dev
/null |
5143 $EGREP "$file_magic_regex" > /dev
/null
; then
5144 newdeplibs
="$newdeplibs $a_deplib"
5151 if test -n "$a_deplib" ; then
5154 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
5155 $ECHO "*** I have the capability to make that library automatically link in when"
5156 $ECHO "*** you link to this library. But I can only do this if you have a"
5157 $ECHO "*** shared version of the library, which you do not appear to have"
5158 $ECHO "*** because I did check the linker path looking for a file starting"
5159 if test -z "$potlib" ; then
5160 $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
5162 $ECHO "*** with $libname and none of the candidates passed a file format test"
5163 $ECHO "*** using a file magic. Last file checked: $potlib"
5167 # Add a -L argument.
5168 newdeplibs
="$newdeplibs $a_deplib"
5170 done # Gone through all deplibs.
5173 set dummy
$deplibs_check_method; shift
5174 match_pattern_regex
=`expr "$deplibs_check_method" : "$1 \(.*\)"`
5175 for a_deplib
in $deplibs; do
5176 name
=`expr $a_deplib : '-l\(.*\)'`
5177 # If $name is empty we are operating on a -L argument.
5178 if test -n "$name" && test "$name" != "0"; then
5179 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
5180 case " $predeps $postdeps " in
5182 newdeplibs
="$newdeplibs $a_deplib"
5187 if test -n "$a_deplib" ; then
5188 libname
=`eval "\\$ECHO \"$libname_spec\""`
5189 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
5190 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
5191 for potent_lib
in $potential_libs; do
5192 potlib
="$potent_lib" # see symlink-check above in file_magic test
5193 if eval "\$ECHO \"X$potent_lib\"" 2>/dev
/null |
$Xsed -e 10q | \
5194 $EGREP "$match_pattern_regex" > /dev
/null
; then
5195 newdeplibs
="$newdeplibs $a_deplib"
5202 if test -n "$a_deplib" ; then
5205 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
5206 $ECHO "*** I have the capability to make that library automatically link in when"
5207 $ECHO "*** you link to this library. But I can only do this if you have a"
5208 $ECHO "*** shared version of the library, which you do not appear to have"
5209 $ECHO "*** because I did check the linker path looking for a file starting"
5210 if test -z "$potlib" ; then
5211 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
5213 $ECHO "*** with $libname and none of the candidates passed a file format test"
5214 $ECHO "*** using a regex pattern. Last file checked: $potlib"
5218 # Add a -L argument.
5219 newdeplibs
="$newdeplibs $a_deplib"
5221 done # Gone through all deplibs.
5225 tmp_deplibs
=`$ECHO "X $deplibs" | $Xsed \
5226 -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
5227 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
5228 for i
in $predeps $postdeps ; do
5229 # can't use Xsed below, because $i might contain '/'
5230 tmp_deplibs
=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
5233 if $ECHO "X $tmp_deplibs" |
$Xsed -e 's/[ ]//g' |
5234 $GREP .
>/dev
/null
; then
5236 if test "X$deplibs_check_method" = "Xnone"; then
5237 $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
5239 $ECHO "*** Warning: inter-library dependencies are not known to be supported."
5241 $ECHO "*** All declared inter-library dependencies are being dropped."
5246 versuffix
=$versuffix_save
5248 release
=$release_save
5249 libname
=$libname_save
5253 *-*-rhapsody* |
*-*-darwin1.
[012])
5254 # On Rhapsody replace the C library with the System framework
5255 newdeplibs
=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
5259 if test "$droppeddeps" = yes; then
5260 if test "$module" = yes; then
5262 $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
5263 $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
5264 $ECHO "*** a static module, that should work as long as the dlopening"
5265 $ECHO "*** application is linked with the -dlopen flag."
5266 if test -z "$global_symbol_pipe"; then
5268 $ECHO "*** However, this would only work if libtool was able to extract symbol"
5269 $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
5270 $ECHO "*** not find such a program. So, this module is probably useless."
5271 $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
5273 if test "$build_old_libs" = no
; then
5274 oldlibs
="$output_objdir/$libname.$libext"
5275 build_libtool_libs
=module
5278 build_libtool_libs
=no
5281 $ECHO "*** The inter-library dependencies that have been dropped here will be"
5282 $ECHO "*** automatically added whenever a program is linked with this library"
5283 $ECHO "*** or is declared to -dlopen it."
5285 if test "$allow_undefined" = no
; then
5287 $ECHO "*** Since this library must not contain undefined symbols,"
5288 $ECHO "*** because either the platform does not support them or"
5289 $ECHO "*** it was explicitly requested with -no-undefined,"
5290 $ECHO "*** libtool will only create a static version of it."
5291 if test "$build_old_libs" = no
; then
5292 oldlibs
="$output_objdir/$libname.$libext"
5293 build_libtool_libs
=module
5296 build_libtool_libs
=no
5301 # Done checking deplibs!
5304 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
5307 newdeplibs
=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
5308 new_inherited_linker_flags
=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
5309 deplibs
=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
5313 # move library search paths that coincide with paths to not yet
5314 # installed libraries to the beginning of the library search list
5316 for path
in $notinst_path; do
5317 case " $new_libs " in
5318 *" -L$path/$objdir "*) ;;
5320 case " $deplibs " in
5321 *" -L$path/$objdir "*)
5322 new_libs
="$new_libs -L$path/$objdir" ;;
5327 for deplib
in $deplibs; do
5330 case " $new_libs " in
5332 *) new_libs
="$new_libs $deplib" ;;
5335 *) new_libs
="$new_libs $deplib" ;;
5340 # All the library-specific variables (install_libdir is set above).
5345 # Test again, we may have decided not to build it any more
5346 if test "$build_libtool_libs" = yes; then
5347 if test "$hardcode_into_libs" = yes; then
5348 # Hardcode the library paths
5351 rpath
="$finalize_rpath"
5352 test "$mode" != relink
&& rpath
="$compile_rpath$rpath"
5353 for libdir
in $rpath; do
5354 if test -n "$hardcode_libdir_flag_spec"; then
5355 if test -n "$hardcode_libdir_separator"; then
5356 if test -z "$hardcode_libdirs"; then
5357 hardcode_libdirs
="$libdir"
5359 # Just accumulate the unique libdirs.
5360 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
5361 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
5364 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
5369 eval flag
=\"$hardcode_libdir_flag_spec\"
5370 dep_rpath
="$dep_rpath $flag"
5372 elif test -n "$runpath_var"; then
5373 case "$perm_rpath " in
5375 *) perm_rpath
="$perm_rpath $libdir" ;;
5379 # Substitute the hardcoded libdirs into the rpath.
5380 if test -n "$hardcode_libdir_separator" &&
5381 test -n "$hardcode_libdirs"; then
5382 libdir
="$hardcode_libdirs"
5383 if test -n "$hardcode_libdir_flag_spec_ld"; then
5384 eval dep_rpath
=\"$hardcode_libdir_flag_spec_ld\"
5386 eval dep_rpath
=\"$hardcode_libdir_flag_spec\"
5389 if test -n "$runpath_var" && test -n "$perm_rpath"; then
5390 # We should set the runpath_var.
5392 for dir
in $perm_rpath; do
5395 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
5397 test -n "$dep_rpath" && deplibs
="$dep_rpath $deplibs"
5400 shlibpath
="$finalize_shlibpath"
5401 test "$mode" != relink
&& shlibpath
="$compile_shlibpath$shlibpath"
5402 if test -n "$shlibpath"; then
5403 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
5406 # Get the real and link names of the library.
5407 eval shared_ext
=\"$shrext_cmds\"
5408 eval library_names
=\"$library_names_spec\"
5409 set dummy
$library_names
5414 if test -n "$soname_spec"; then
5415 eval soname
=\"$soname_spec\"
5419 if test -z "$dlname"; then
5423 lib
="$output_objdir/$realname"
5427 linknames
="$linknames $link"
5430 # Use standard objects if they are pic
5431 test -z "$pic_flag" && libobjs
=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
5434 if test -n "$export_symbols" && test -n "$include_expsyms"; then
5435 $opt_dry_run ||
cp "$export_symbols" "$output_objdir/$libname.uexp"
5436 export_symbols
="$output_objdir/$libname.uexp"
5437 delfiles
="$delfiles $export_symbols"
5440 orig_export_symbols
=
5443 if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
5444 # exporting using user supplied symfile
5445 if test "x`$SED 1q $export_symbols`" != xEXPORTS
; then
5446 # and it's NOT already a .def file. Must figure out
5447 # which of the given symbols are data symbols and tag
5448 # them as such. So, trigger use of export_symbols_cmds.
5449 # export_symbols gets reassigned inside the "prepare
5450 # the list of exported symbols" if statement, so the
5451 # include_expsyms logic still works.
5452 orig_export_symbols
="$export_symbols"
5454 always_export_symbols
=yes
5460 # Prepare the list of exported symbols
5461 if test -z "$export_symbols"; then
5462 if test "$always_export_symbols" = yes ||
test -n "$export_symbols_regex"; then
5463 func_echo
"generating symbol list for \`$libname.la'"
5464 export_symbols
="$output_objdir/$libname.exp"
5465 $opt_dry_run ||
$RM $export_symbols
5466 cmds
=$export_symbols_cmds
5467 save_ifs
="$IFS"; IFS
='~'
5468 for cmd
in $cmds; do
5471 if len
=`expr "X$cmd" : ".*"` &&
5472 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
5473 func_show_eval
"$cmd" 'exit $?'
5474 skipped_export
=false
5476 # The command line is too long to execute in one step.
5477 func_echo
"using reloadable object file for export list..."
5479 # Break out early, otherwise skipped_export may be
5480 # set to false by a later but shorter cmd.
5485 if test -n "$export_symbols_regex"; then
5486 func_show_eval
'$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
5487 func_show_eval
'$MV "${export_symbols}T" "$export_symbols"'
5492 if test -n "$export_symbols" && test -n "$include_expsyms"; then
5493 tmp_export_symbols
="$export_symbols"
5494 test -n "$orig_export_symbols" && tmp_export_symbols
="$orig_export_symbols"
5495 $opt_dry_run ||
eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
5498 if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
5499 # The given exports_symbols file has to be filtered, so filter it.
5500 func_echo
"filter symbol list for \`$libname.la' to tag DATA exports"
5501 # FIXME: $output_objdir/$libname.filter potentially contains lots of
5502 # 's' commands which not all seds can handle. GNU sed should be fine
5503 # though. Also, the filter scales superlinearly with the number of
5504 # global variables. join(1) would be nice here, but unfortunately
5505 # isn't a blessed tool.
5506 $opt_dry_run ||
$SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
5507 delfiles
="$delfiles $export_symbols $output_objdir/$libname.filter"
5508 export_symbols
=$output_objdir/$libname.def
5509 $opt_dry_run ||
$SED -f $output_objdir/$libname.filter
< $orig_export_symbols > $export_symbols
5513 for test_deplib
in $deplibs; do
5514 case " $convenience " in
5515 *" $test_deplib "*) ;;
5517 tmp_deplibs
="$tmp_deplibs $test_deplib"
5521 deplibs
="$tmp_deplibs"
5523 if test -n "$convenience"; then
5524 if test -n "$whole_archive_flag_spec"; then
5525 save_libobjs
=$libobjs
5526 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
5528 gentop
="$output_objdir/${outputname}x"
5529 generated
="$generated $gentop"
5531 func_extract_archives
$gentop $convenience
5532 libobjs
="$libobjs $func_extract_archives_result"
5536 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
5537 eval flag
=\"$thread_safe_flag_spec\"
5538 linker_flags
="$linker_flags $flag"
5541 # Make a backup of the uninstalled library when relinking
5542 if test "$mode" = relink
; then
5543 $opt_dry_run ||
eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' ||
exit $?
5546 # Do each of the archive commands.
5547 if test "$module" = yes && test -n "$module_cmds" ; then
5548 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
5549 eval test_cmds
=\"$module_expsym_cmds\"
5550 cmds
=$module_expsym_cmds
5552 eval test_cmds
=\"$module_cmds\"
5556 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
5557 eval test_cmds
=\"$archive_expsym_cmds\"
5558 cmds
=$archive_expsym_cmds
5560 eval test_cmds
=\"$archive_cmds\"
5565 if test "X$skipped_export" != "X:" &&
5566 len
=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
5567 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
5570 # The command line is too long to link in one step, link piecewise
5571 # or, if using GNU ld and skipped_export is not :, use a linker
5574 # Save the value of $output and $libobjs because we want to
5575 # use them later. If we have whole_archive_flag_spec, we
5576 # want to use save_libobjs as it was before
5577 # whole_archive_flag_spec was expanded, because we can't
5578 # assume the linker understands whole_archive_flag_spec.
5579 # This may have to be revisited, in case too many
5580 # convenience libraries get linked in and end up exceeding
5582 if test -z "$convenience" ||
test -z "$whole_archive_flag_spec"; then
5583 save_libobjs
=$libobjs
5586 output_la
=`$ECHO "X$output" | $Xsed -e "$basename"`
5588 # Clear the reloadable object creation command queue and
5589 # initialize k to one.
5596 if test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
5597 output
=${output_objdir}/${output_la}.lnkscript
5598 func_echo
"creating GNU ld script: $output"
5599 $ECHO 'INPUT (' > $output
5600 for obj
in $save_libobjs
5602 $ECHO \""$obj"\" >> $output
5604 $ECHO ')' >> $output
5605 delfiles
="$delfiles $output"
5606 elif test "X$skipped_export" != "X:" && test "X$file_list_spec" != X
; then
5607 output
=${output_objdir}/${output_la}.lnk
5608 func_echo
"creating linker input file list: $output"
5610 for obj
in $save_libobjs
5612 $ECHO "$obj" >> $output
5614 delfiles
="$delfiles $output"
5615 output
=\"$file_list_spec$output\"
5617 func_echo
"creating reloadable object files..."
5618 output
=$output_objdir/$output_la-${k}.
$objext
5619 # Loop over the list of objects to be linked.
5620 for obj
in $save_libobjs
5622 eval test_cmds
=\"$reload_cmds $objlist $last_robj\"
5623 if test "X$objlist" = X ||
5624 { len
=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
5625 test "$len" -le "$max_cmd_len"; }; then
5626 objlist
="$objlist $obj"
5628 # The command $test_cmds is almost too long, add a
5629 # command to the queue.
5630 if test "$k" -eq 1 ; then
5631 # The first file doesn't have a previous command to add.
5632 eval concat_cmds
=\"$reload_cmds $objlist $last_robj\"
5634 # All subsequent reloadable object files will link in
5635 # the last one created.
5636 eval concat_cmds
=\"\
$concat_cmds~
$reload_cmds $objlist $last_robj\"
5638 last_robj
=$output_objdir/$output_la-${k}.
$objext
5640 output
=$output_objdir/$output_la-${k}.
$objext
5645 # Handle the remaining objects by creating one last
5646 # reloadable object file. All subsequent reloadable object
5647 # files will link in the last one created.
5648 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
5649 eval concat_cmds
=\"\
${concat_cmds}$reload_cmds $objlist $last_robj\"
5651 if ${skipped_export-false}; then
5652 func_echo
"generating symbol list for \`$libname.la'"
5653 export_symbols
="$output_objdir/$libname.exp"
5654 $opt_dry_run ||
$RM $export_symbols
5656 # Append the command to create the export file.
5657 eval concat_cmds
=\"\
$concat_cmds~
$export_symbols_cmds\"
5660 # Set up a command to remove the reloadable object files
5661 # after they are used.
5663 while test "$i" -lt "$k"
5666 delfiles
="$delfiles $output_objdir/$output_la-${i}.$objext"
5669 func_echo
"creating a temporary reloadable object file: $output"
5671 # Loop through the commands generated above and execute them.
5672 save_ifs
="$IFS"; IFS
='~'
5673 for cmd
in $concat_cmds; do
5676 func_quote_for_expand
"$cmd"
5677 eval "func_echo $func_quote_for_expand_result"
5679 $opt_dry_run ||
eval "$cmd" ||
{
5682 # Restore the uninstalled library and exit
5683 if test "$mode" = relink
; then
5684 ( cd "$output_objdir" && \
5685 $RM "${realname}T" && \
5686 $MV "${realname}U" "$realname" )
5696 # Restore the value of output.
5699 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
5700 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
5702 # Expand the library linking commands again to reset the
5703 # value of $libobjs for piecewise linking.
5705 # Do each of the archive commands.
5706 if test "$module" = yes && test -n "$module_cmds" ; then
5707 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
5708 cmds
=$module_expsym_cmds
5713 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
5714 cmds
=$archive_expsym_cmds
5721 if test -n "$delfiles"; then
5722 # Append the command to remove temporary files to $cmds.
5723 eval cmds
=\"\
$cmds~\
$RM $delfiles\"
5726 # Add any objects from preloaded convenience libraries
5727 if test -n "$dlprefiles"; then
5728 gentop
="$output_objdir/${outputname}x"
5729 generated
="$generated $gentop"
5731 func_extract_archives
$gentop $dlprefiles
5732 libobjs
="$libobjs $func_extract_archives_result"
5735 save_ifs
="$IFS"; IFS
='~'
5736 for cmd
in $cmds; do
5740 func_quote_for_expand
"$cmd"
5741 eval "func_echo $func_quote_for_expand_result"
5743 $opt_dry_run ||
eval "$cmd" ||
{
5746 # Restore the uninstalled library and exit
5747 if test "$mode" = relink
; then
5748 ( cd "$output_objdir" && \
5749 $RM "${realname}T" && \
5750 $MV "${realname}U" "$realname" )
5758 # Restore the uninstalled library and exit
5759 if test "$mode" = relink
; then
5760 $opt_dry_run ||
eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' ||
exit $?
5762 if test -n "$convenience"; then
5763 if test -z "$whole_archive_flag_spec"; then
5764 func_show_eval
'${RM}r "$gentop"'
5771 # Create links to the real library.
5772 for linkname
in $linknames; do
5773 if test "$realname" != "$linkname"; then
5774 func_show_eval
'(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
5778 # If -module or -export-dynamic was specified, set the dlname.
5779 if test "$module" = yes ||
test "$export_dynamic" = yes; then
5780 # On all known operating systems, these are identical.
5787 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
5788 func_warning
"\`-dlopen' is ignored for objects"
5791 test -n "$deplibs" && \
5792 func_warning
"\`-l' and \`-L' are ignored for objects"
5794 test -n "$rpath" && \
5795 func_warning
"\`-rpath' is ignored for objects"
5797 test -n "$xrpath" && \
5798 func_warning
"\`-R' is ignored for objects"
5800 test -n "$vinfo" && \
5801 func_warning
"\`-version-info' is ignored for objects"
5803 test -n "$release" && \
5804 func_warning
"\`-release' is ignored for objects"
5808 test -n "$objs$old_deplibs" && \
5809 func_fatal_error
"cannot build library object \`$output' from non-libtool objects"
5812 obj
=`$ECHO "X$output" | $Xsed -e "$lo2o"`
5820 # Delete the old objects.
5821 $opt_dry_run ||
$RM $obj $libobj
5823 # Objects from convenience libraries. This assumes
5824 # single-version convenience libraries. Whenever we create
5825 # different ones for PIC/non-PIC, this we'll have to duplicate
5829 # reload_cmds runs $LD directly, so let us get rid of
5830 # -Wl from whole_archive_flag_spec and hope we can get by with
5831 # turning comma into space..
5834 if test -n "$convenience"; then
5835 if test -n "$whole_archive_flag_spec"; then
5836 eval tmp_whole_archive_flags
=\"$whole_archive_flag_spec\"
5837 reload_conv_objs
=$reload_objs\
`$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
5839 gentop
="$output_objdir/${obj}x"
5840 generated
="$generated $gentop"
5842 func_extract_archives
$gentop $convenience
5843 reload_conv_objs
="$reload_objs $func_extract_archives_result"
5847 # Create the old-style object.
5848 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
5851 func_execute_cmds
"$reload_cmds" 'exit $?'
5853 # Exit if we aren't doing a library object file.
5854 if test -z "$libobj"; then
5855 if test -n "$gentop"; then
5856 func_show_eval
'${RM}r "$gentop"'
5862 if test "$build_libtool_libs" != yes; then
5863 if test -n "$gentop"; then
5864 func_show_eval
'${RM}r "$gentop"'
5867 # Create an invalid libtool object if no PIC, so that we don't
5868 # accidentally link it into a program.
5869 # $show "echo timestamp > $libobj"
5870 # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
5874 if test -n "$pic_flag" ||
test "$pic_mode" != default
; then
5875 # Only do commands if we really have different PIC objects.
5876 reload_objs
="$libobjs $reload_conv_objs"
5878 func_execute_cmds
"$reload_cmds" 'exit $?'
5881 if test -n "$gentop"; then
5882 func_show_eval
'${RM}r "$gentop"'
5890 *cygwin
*) func_stripname
'' '.exe' "$output"
5891 output
=$func_stripname_result.exe
;;
5893 test -n "$vinfo" && \
5894 func_warning
"\`-version-info' is ignored for programs"
5896 test -n "$release" && \
5897 func_warning
"\`-release' is ignored for programs"
5899 test "$preload" = yes \
5900 && test "$dlopen_support" = unknown \
5901 && test "$dlopen_self" = unknown \
5902 && test "$dlopen_self_static" = unknown
&& \
5903 func_warning
"\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
5906 *-*-rhapsody* |
*-*-darwin1.
[012])
5907 # On Rhapsody replace the C library is the System framework
5908 compile_deplibs
=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
5909 finalize_deplibs
=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
5915 # Don't allow lazy linking, it breaks C++ global constructors
5916 # But is supposedly fixed on 10.4 or later (yay!).
5917 if test "$tagname" = CXX
; then
5918 case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
5920 compile_command
="$compile_command ${wl}-bind_at_load"
5921 finalize_command
="$finalize_command ${wl}-bind_at_load"
5925 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
5926 compile_deplibs
=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
5927 finalize_deplibs
=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
5932 # move library search paths that coincide with paths to not yet
5933 # installed libraries to the beginning of the library search list
5935 for path
in $notinst_path; do
5936 case " $new_libs " in
5937 *" -L$path/$objdir "*) ;;
5939 case " $compile_deplibs " in
5940 *" -L$path/$objdir "*)
5941 new_libs
="$new_libs -L$path/$objdir" ;;
5946 for deplib
in $compile_deplibs; do
5949 case " $new_libs " in
5951 *) new_libs
="$new_libs $deplib" ;;
5954 *) new_libs
="$new_libs $deplib" ;;
5957 compile_deplibs
="$new_libs"
5960 compile_command
="$compile_command $compile_deplibs"
5961 finalize_command
="$finalize_command $finalize_deplibs"
5963 if test -n "$rpath$xrpath"; then
5964 # If the user specified any rpath flags, then add them.
5965 for libdir
in $rpath $xrpath; do
5966 # This is the magic to use -rpath.
5967 case "$finalize_rpath " in
5969 *) finalize_rpath
="$finalize_rpath $libdir" ;;
5974 # Now hardcode the library paths
5977 for libdir
in $compile_rpath $finalize_rpath; do
5978 if test -n "$hardcode_libdir_flag_spec"; then
5979 if test -n "$hardcode_libdir_separator"; then
5980 if test -z "$hardcode_libdirs"; then
5981 hardcode_libdirs
="$libdir"
5983 # Just accumulate the unique libdirs.
5984 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
5985 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
5988 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
5993 eval flag
=\"$hardcode_libdir_flag_spec\"
5994 rpath
="$rpath $flag"
5996 elif test -n "$runpath_var"; then
5997 case "$perm_rpath " in
5999 *) perm_rpath
="$perm_rpath $libdir" ;;
6003 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
6004 testbindir
=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
6005 case :$dllsearchpath: in
6007 *) dllsearchpath
="$dllsearchpath:$libdir";;
6009 case :$dllsearchpath: in
6010 *":$testbindir:"*) ;;
6011 *) dllsearchpath
="$dllsearchpath:$testbindir";;
6016 # Substitute the hardcoded libdirs into the rpath.
6017 if test -n "$hardcode_libdir_separator" &&
6018 test -n "$hardcode_libdirs"; then
6019 libdir
="$hardcode_libdirs"
6020 eval rpath
=\" $hardcode_libdir_flag_spec\"
6022 compile_rpath
="$rpath"
6026 for libdir
in $finalize_rpath; do
6027 if test -n "$hardcode_libdir_flag_spec"; then
6028 if test -n "$hardcode_libdir_separator"; then
6029 if test -z "$hardcode_libdirs"; then
6030 hardcode_libdirs
="$libdir"
6032 # Just accumulate the unique libdirs.
6033 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
6034 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
6037 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
6042 eval flag
=\"$hardcode_libdir_flag_spec\"
6043 rpath
="$rpath $flag"
6045 elif test -n "$runpath_var"; then
6046 case "$finalize_perm_rpath " in
6048 *) finalize_perm_rpath
="$finalize_perm_rpath $libdir" ;;
6052 # Substitute the hardcoded libdirs into the rpath.
6053 if test -n "$hardcode_libdir_separator" &&
6054 test -n "$hardcode_libdirs"; then
6055 libdir
="$hardcode_libdirs"
6056 eval rpath
=\" $hardcode_libdir_flag_spec\"
6058 finalize_rpath
="$rpath"
6060 if test -n "$libobjs" && test "$build_old_libs" = yes; then
6061 # Transform all the library objects into standard objects.
6062 compile_command
=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
6063 finalize_command
=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
6066 func_generate_dlsyms
"$outputname" "@PROGRAM@" "no"
6068 # template prelinking step
6069 if test -n "$prelink_cmds"; then
6070 func_execute_cmds
"$prelink_cmds" 'exit $?'
6073 wrappers_required
=yes
6075 *cygwin
* |
*mingw
* )
6076 if test "$build_libtool_libs" != yes; then
6077 wrappers_required
=no
6081 if test "$need_relink" = no ||
test "$build_libtool_libs" != yes; then
6082 wrappers_required
=no
6086 if test "$wrappers_required" = no
; then
6087 # Replace the output file specification.
6088 compile_command
=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
6089 link_command
="$compile_command$compile_rpath"
6091 # We have no uninstalled library dependencies, so finalize right now.
6093 func_show_eval
"$link_command" 'exit_status=$?'
6095 # Delete the generated files.
6096 if test -f "$output_objdir/${outputname}S.${objext}"; then
6097 func_show_eval
'$RM "$output_objdir/${outputname}S.${objext}"'
6103 if test -n "$compile_shlibpath$finalize_shlibpath"; then
6104 compile_command
="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
6106 if test -n "$finalize_shlibpath"; then
6107 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
6112 if test -n "$runpath_var"; then
6113 if test -n "$perm_rpath"; then
6114 # We should set the runpath_var.
6116 for dir
in $perm_rpath; do
6119 compile_var
="$runpath_var=\"$rpath\$$runpath_var\" "
6121 if test -n "$finalize_perm_rpath"; then
6122 # We should set the runpath_var.
6124 for dir
in $finalize_perm_rpath; do
6127 finalize_var
="$runpath_var=\"$rpath\$$runpath_var\" "
6131 if test "$no_install" = yes; then
6132 # We don't need to create a wrapper script.
6133 link_command
="$compile_var$compile_command$compile_rpath"
6134 # Replace the output file specification.
6135 link_command
=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
6136 # Delete the old output file.
6137 $opt_dry_run ||
$RM $output
6138 # Link the executable and exit
6139 func_show_eval
"$link_command" 'exit $?'
6143 if test "$hardcode_action" = relink
; then
6144 # Fast installation is not supported
6145 link_command
="$compile_var$compile_command$compile_rpath"
6146 relink_command
="$finalize_var$finalize_command$finalize_rpath"
6148 func_warning
"this platform does not like uninstalled shared libraries"
6149 func_warning
"\`$output' will be relinked during installation"
6151 if test "$fast_install" != no
; then
6152 link_command
="$finalize_var$compile_command$finalize_rpath"
6153 if test "$fast_install" = yes; then
6154 relink_command
=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
6156 # fast_install is set to needless
6160 link_command
="$compile_var$compile_command$compile_rpath"
6161 relink_command
="$finalize_var$finalize_command$finalize_rpath"
6165 # Replace the output file specification.
6166 link_command
=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
6168 # Delete the old output files.
6169 $opt_dry_run ||
$RM $output $output_objdir/$outputname $output_objdir/lt-
$outputname
6171 func_show_eval
"$link_command" 'exit $?'
6173 # Now create the wrapper script.
6174 func_echo
"creating $output"
6176 # Quote the relink command for shipping.
6177 if test -n "$relink_command"; then
6178 # Preserve any variables that may affect compiler behavior
6179 for var
in $variables_saved_for_relink; do
6180 if eval test -z \"\
${$var+set}\"; then
6181 relink_command
="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
6182 elif eval var_value
=\$
$var; test -z "$var_value"; then
6183 relink_command
="$var=; export $var; $relink_command"
6185 func_quote_for_eval
"$var_value"
6186 relink_command
="$var=$func_quote_for_eval_result; export $var; $relink_command"
6189 relink_command
="(cd `pwd`; $relink_command)"
6190 relink_command
=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
6193 # Quote $ECHO for shipping.
6194 if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
6196 [\\/]* |
[A-Za-z
]:[\\/]*) qecho
="$SHELL $progpath --fallback-echo";;
6197 *) qecho
="$SHELL `pwd`/$progpath --fallback-echo";;
6199 qecho
=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
6201 qecho
=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
6204 # Only actually do things if not in dry run mode.
6206 # win32 will think the script is a binary if it has
6207 # a .exe suffix, so we strip it off here.
6209 *.exe
) func_stripname
'' '.exe' "$output"
6210 output
=$func_stripname_result ;;
6212 # test for cygwin because mv fails w/o .exe extensions
6216 func_stripname
'' '.exe' "$outputname"
6217 outputname
=$func_stripname_result ;;
6221 *cygwin
* |
*mingw
* )
6222 output_name
=`basename $output`
6223 output_path
=`dirname $output`
6224 cwrappersource
="$output_path/$objdir/lt-$output_name.c"
6225 cwrapper
="$output_path/$output_name.exe"
6226 $RM $cwrappersource $cwrapper
6227 trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
6229 cat > $cwrappersource <<EOF
6231 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
6232 Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
6234 The $output program cannot be directly executed until all the libtool
6235 libraries that it depends on are installed.
6237 This wrapper executable should never be moved out of the build directory.
6238 If it is, it will not operate correctly.
6240 Currently, it simply execs the wrapper *script* "/bin/sh $output",
6241 but could eventually absorb all of the scripts functionality and
6242 exec $objdir/$outputname directly.
6245 cat >> $cwrappersource<<"EOF"
6248 /* #include <unistd.h> */
6254 #include <sys/stat.h>
6255 #include <windows.h>
6257 #if defined(PATH_MAX)
6258 # define LT_PATHMAX PATH_MAX
6259 #elif defined(MAXPATHLEN)
6260 # define LT_PATHMAX MAXPATHLEN
6262 # define LT_PATHMAX 1024
6265 #ifndef DIR_SEPARATOR
6266 # define DIR_SEPARATOR '/'
6267 # define PATH_SEPARATOR ':'
6270 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
6272 # define HAVE_DOS_BASED_FILE_SYSTEM
6273 # ifndef DIR_SEPARATOR_2
6274 # define DIR_SEPARATOR_2 '\\'
6276 # ifndef PATH_SEPARATOR_2
6277 # define PATH_SEPARATOR_2 ';'
6281 #ifndef DIR_SEPARATOR_2
6282 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
6283 #else /* DIR_SEPARATOR_2 */
6284 # define IS_DIR_SEPARATOR(ch) \
6285 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
6286 #endif /* DIR_SEPARATOR_2 */
6288 #ifndef PATH_SEPARATOR_2
6289 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
6290 #else /* PATH_SEPARATOR_2 */
6291 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
6292 #endif /* PATH_SEPARATOR_2 */
6294 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
6295 #define XFREE(stale) do { \
6296 if (stale) { free ((void *) stale); stale = 0; } \
6299 /* -DDEBUG is fairly common in CFLAGS. */
6301 #if defined DEBUGWRAPPER
6302 # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
6304 # define DEBUG(format, ...)
6307 const char *program_name = NULL;
6309 void * xmalloc (size_t num);
6310 char * xstrdup (const char *string);
6311 const char * base_name (const char *name);
6312 char * find_executable(const char *wrapper);
6313 int check_executable(const char *path);
6314 char * strendzap(char *str, const char *pat);
6315 void lt_fatal (const char *message, ...);
6318 win32_execv(const char* path, char const** args)
6323 PROCESS_INFORMATION pinfo;
6327 while (*args != NULL)
6329 if (space < strlen(*args))
6333 strcpy(cmdline + (1022-space), *args);
6334 space -= strlen(*args);
6338 cmdline[1022-space] = ' ';
6339 strcpy(cmdline + (1023-space), *args);
6340 space -= strlen(*args) + 1;
6345 memset(&sinfo, 0, sizeof(sinfo));
6346 sinfo.cb = sizeof(sinfo);
6348 if (!CreateProcess(NULL, cmdline, NULL, NULL, TRUE, 0, NULL, NULL,
6352 WaitForSingleObject(pinfo.hProcess, INFINITE);
6353 GetExitCodeProcess(pinfo.hProcess, &exCode);
6354 ExitProcess(exCode);
6358 main (int argc, char *argv[])
6363 program_name = (char *) xstrdup (base_name (argv[0]));
6364 DEBUG("(main) argv[0] : %s\n",argv[0]);
6365 DEBUG("(main) program_name : %s\n",program_name);
6366 newargz = XMALLOC(char *, argc+2);
6369 cat >> $cwrappersource <<EOF
6370 newargz[0] = (char *) xstrdup("$SHELL");
6373 cat >> $cwrappersource <<"EOF"
6374 newargz
[1] = find_executable
(argv
[0]);
6375 if (newargz
[1] == NULL
)
6376 lt_fatal
("Couldn't find %s", argv
[0]);
6384 DEBUG
("(main) found exe at : %s\n",newargz
[1]);
6385 /* we know the
script has the same name
, without the .exe
*/
6386 /* so
make sure newargz
[1] doesn
't end in .exe */
6387 strendzap(newargz[1],".exe");
6388 for (i = 1; i < argc; i++)
6389 newargz[i+1] = xstrdup(argv[i]);
6390 newargz[argc+1] = NULL;
6392 for (i=0; i<argc+1; i++)
6394 DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
6402 cat >> $cwrappersource <<EOF
6403 win32_execv("$SHELL",(char const **)newargz);
6407 cat >> $cwrappersource <<EOF
6408 win32_execv("$SHELL",newargz);
6413 cat >> $cwrappersource <<"EOF"
6418 xmalloc (size_t num)
6420 void * p = (void *) malloc (num);
6422 lt_fatal ("Memory exhausted");
6428 xstrdup (const char *string)
6430 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
6435 base_name (const char *name)
6439 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
6440 /* Skip over the disk name in MSDOS pathnames. */
6441 if (isalpha ((unsigned char)name[0]) && name[1] == ':')
6445 for (base = name; *name; name++)
6446 if (IS_DIR_SEPARATOR (*name))
6452 check_executable(const char * path)
6456 DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
6457 if ((!path) || (!*path))
6460 if ((stat (path, &st) >= 0) &&
6462 /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
6463 #if defined (S_IXOTH)
6464 ((st.st_mode & S_IXOTH) == S_IXOTH) ||
6466 #if defined (S_IXGRP)
6467 ((st.st_mode & S_IXGRP) == S_IXGRP) ||
6469 #if defined(S_IXUSR)
6470 ((st.st_mode & S_IXUSR) == S_IXUSR))
6472 ((st.st_mode & _S_IEXEC) == _S_IEXEC))
6480 /* Searches for the full path of the wrapper. Returns
6481 newly allocated full path name if found, NULL otherwise */
6483 find_executable (const char* wrapper)
6488 /* static buffer for getcwd */
6489 char tmp[LT_PATHMAX + 1];
6493 DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
6495 if ((wrapper == NULL) || (*wrapper == '\
0'))
6498 /* Absolute path? */
6499 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
6500 if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
6502 concat_name = xstrdup (wrapper);
6503 if (check_executable(concat_name))
6510 if (IS_DIR_SEPARATOR (wrapper[0]))
6512 concat_name = xstrdup (wrapper);
6513 if (check_executable(concat_name))
6517 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
6521 for (p = wrapper; *p; p++)
6529 /* no slashes; search PATH */
6530 const char* path = getenv ("PATH");
6533 for (p = path; *p; p = p_next)
6537 for (q = p; *q; q++)
6538 if (IS_PATH_SEPARATOR(*q))
6541 p_next = (*q == '\
0' ? q : q + 1);
6544 /* empty path: current directory */
6545 if (getcwd (tmp, LT_PATHMAX) == NULL)
6546 lt_fatal ("getcwd failed");
6547 tmp_len = strlen(tmp);
6548 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
6549 memcpy (concat_name, tmp, tmp_len);
6550 concat_name[tmp_len] = '/';
6551 strcpy (concat_name + tmp_len + 1, wrapper);
6555 concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
6556 memcpy (concat_name, p, p_len);
6557 concat_name[p_len] = '/';
6558 strcpy (concat_name + p_len + 1, wrapper);
6560 if (check_executable(concat_name))
6565 /* not found in PATH; assume curdir */
6567 /* Relative path | not found in path: prepend cwd */
6568 if (getcwd (tmp, LT_PATHMAX) == NULL)
6569 lt_fatal ("getcwd failed");
6570 tmp_len = strlen(tmp);
6571 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
6572 memcpy (concat_name, tmp, tmp_len);
6573 concat_name[tmp_len] = '/';
6574 strcpy (concat_name + tmp_len + 1, wrapper);
6576 if (check_executable(concat_name))
6583 strendzap(char *str, const char *pat)
6587 assert(str != NULL);
6588 assert(pat != NULL);
6591 patlen = strlen(pat);
6595 str += len - patlen;
6596 if (strcmp(str, pat) == 0)
6603 lt_error_core (int exit_status, const char * mode,
6604 const char * message, va_list ap)
6606 fprintf (stderr, "%s: %s: ", program_name, mode);
6607 vfprintf (stderr, message, ap);
6608 fprintf (stderr, ".\n");
6610 if (exit_status >= 0)
6615 lt_fatal (const char *message, ...)
6618 va_start (ap, message);
6619 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
6623 # we should really use a build-platform specific compiler
6624 # here, but OTOH, the wrappers (shell script and this C one)
6625 # are only useful if you want to execute the "real" binary.
6626 # Since the "real" binary is built for $host, then this
6627 # wrapper might as well be built for $host, too.
6628 $opt_dry_run || $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
6632 trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
6637 # $output - temporary wrapper script for $objdir/$outputname
6638 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
6640 # The $output program cannot be directly executed until all the libtool
6641 # libraries that it depends on are installed.
6643 # This wrapper script should never be moved out of the build directory.
6644 # If it is, it will not operate correctly.
6646 # Sed substitution that helps us do robust quoting. It backslashifies
6647 # metacharacters that are still active within double-quoted strings.
6648 Xsed='${SED} -e 1s
/^X
//'
6649 sed_quote_subst='$sed_quote_subst'
6651 # Be Bourne compatible
6652 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
6655 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
6656 # is contrary to our usage. Disable this feature.
6657 alias -g '\
${1+\"\$@\"}'='\"\$@
\"'
6658 setopt NO_GLOB_SUBST
6660 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
6662 BIN_SH=xpg4; export BIN_SH # for Tru64
6663 DUALCASE=1; export DUALCASE # for MKS sh
6665 # The HP-UX ksh and POSIX shell print the target directory to stdout
6667 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
6669 relink_command=\"$relink_command\"
6671 # This environment variable determines our operation mode.
6672 if test \"\$libtool_install_magic\" = \"$magic\"; then
6673 # install mode needs the following variables:
6674 generated_by_libtool_version='$macro_version'
6675 notinst_deplibs='$notinst_deplibs'
6677 # When we are sourced in execute mode, \$file and \$ECHO are already set.
6678 if test \"\$libtool_execute_magic\" != \"$magic\"; then
6681 # Make sure echo works.
6682 if test \"X\$1\" = X--no-reexec; then
6683 # Discard the --no-reexec flag, and continue.
6685 elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X
\t'; then
6686 # Yippee, \$ECHO works!
6689 # Restart under the correct shell, and then maybe \$ECHO will work.
6690 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
6696 # Find the directory that this script lives in.
6697 thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's
%/[^
/]*$
%%'\`
6698 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
6700 # Follow symbolic links until we get to the real thisdir.
6701 file=\`ls -ld \"\$file\" | ${SED} -n 's
/.
*-> //p
'\`
6702 while test -n \"\$file\"; do
6703 destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's
%/[^
/]*\$
%%'\`
6705 # If there was a directory component, then change thisdir.
6706 if test \"x\$destdir\" != \"x\$file\"; then
6707 case \"\$destdir\" in
6708 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
6709 *) thisdir=\"\$thisdir/\$destdir\" ;;
6713 file=\`\$ECHO \"X\$file\" | \$Xsed -e 's
%^.
*/%%'\`
6714 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's
/.
*-> //p
'\`
6717 # Try to get the absolute directory name.
6718 absdir=\`cd \"\$thisdir\" && pwd\`
6719 test -n \"\$absdir\" && thisdir=\"\$absdir\"
6722 if test "$fast_install" = yes; then
6724 program=lt-'$outputname'$exeext
6725 progdir=\"\$thisdir/$objdir\"
6727 if test ! -f \"\$progdir/\$program\" ||
6728 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
6729 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
6731 file=\"\$\$-\$program\"
6733 if test ! -d \"\$progdir\"; then
6734 $MKDIR \"\$progdir\"
6736 $RM \"\$progdir/\$file\"
6741 # relink executable if necessary
6742 if test -n \"\$relink_command\"; then
6743 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
6745 $ECHO \"\$relink_command_output\" >&2
6746 $RM \"\$progdir/\$file\"
6751 $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
6752 { $RM \"\$progdir/\$program\";
6753 $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
6754 $RM \"\$progdir/\$file\"
6758 program='$outputname'
6759 progdir=\"\$thisdir/$objdir\"
6765 if test -f \"\$progdir/\$program\"; then"
6767 # Export our shlibpath_var if we have one.
6768 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
6770 # Add our own library path to $shlibpath_var
6771 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
6773 # Some systems cannot cope with colon-terminated $shlibpath_var
6774 # The second colon is a workaround for a bug in BeOS R4 sed
6775 $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's
/::*\$
//'\`
6777 export $shlibpath_var
6781 # fixup the dll searchpath if we need to.
6782 if test -n "$dllsearchpath"; then
6784 # Add the dll search path components to the executable PATH
6785 PATH=$dllsearchpath:\$PATH
6790 if test \"\$libtool_execute_magic\" != \"$magic\"; then
6791 # Run the actual program with our arguments.
6794 # Backslashes separate directories on plain windows
6795 *-*-mingw | *-*-os2*)
6797 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
6803 exec \"\$progdir/\$program\" \${1+\"\$@\"}
6808 \$ECHO \"\$0: cannot exec \$program \$*\"
6812 # The program doesn't exist.
6813 \
$ECHO \"\
$0: error
: \\\
`\$progdir/\$program' does not exist\" 1>&2
6814 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
6815 $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
6826 # See if we need to build an old-fashioned archive.
6827 for oldlib in $oldlibs; do
6829 if test "$build_libtool_libs" = convenience; then
6830 oldobjs="$libobjs_save $symfileobj"
6831 addlibs="$convenience"
6832 build_libtool_libs=no
6834 if test "$build_libtool_libs" = module; then
6835 oldobjs="$libobjs_save"
6836 build_libtool_libs=no
6838 oldobjs="$old_deplibs $non_pic_objects"
6839 if test "$preload" = yes && test -f "$symfileobj"; then
6840 oldobjs="$oldobjs $symfileobj"
6843 addlibs="$old_convenience"
6846 if test -n "$addlibs"; then
6847 gentop="$output_objdir/${outputname}x"
6848 generated="$generated $gentop"
6850 func_extract_archives $gentop $addlibs
6851 oldobjs="$oldobjs $func_extract_archives_result"
6854 # Do each command in the archive commands.
6855 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
6856 cmds=$old_archive_from_new_cmds
6859 # Add any objects from preloaded convenience libraries
6860 if test -n "$dlprefiles"; then
6861 gentop="$output_objdir/${outputname}x"
6862 generated="$generated $gentop"
6864 func_extract_archives $gentop $dlprefiles
6865 oldobjs="$oldobjs $func_extract_archives_result"
6868 # POSIX demands no paths to be encoded in archives. We have
6869 # to avoid creating archives with duplicate basenames if we
6870 # might have to extract them afterwards, e.g., when creating a
6871 # static archive out of a convenience library, or when linking
6872 # the entirety of a libtool archive into another (currently
6873 # not supported by libtool).
6874 if (for obj in $oldobjs
6876 func_basename "$obj"
6877 $ECHO "$func_basename_result"
6878 done | sort | sort -uc >/dev/null 2>&1); then
6881 $ECHO "copying selected object files to avoid basename conflicts..."
6882 gentop="$output_objdir/${outputname}x"
6883 generated="$generated $gentop"
6884 func_mkdir_p "$gentop"
6885 save_oldobjs=$oldobjs
6888 for obj in $save_oldobjs
6890 func_basename "$obj"
6891 objbase="$func_basename_result"
6892 case " $oldobjs " in
6893 " ") oldobjs=$obj ;;
6896 # Make sure we don't pick an alternate name that also
6898 newobj=lt$counter-$objbase
6899 counter=`expr $counter + 1`
6900 case " $oldobjs " in
6901 *[\ /]"$newobj "*) ;;
6902 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
6905 func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
6906 oldobjs="$oldobjs $gentop/$newobj"
6908 *) oldobjs="$oldobjs $obj" ;;
6912 eval cmds=\"$old_archive_cmds\"
6914 if len=`expr "X$cmds" : ".*" 2>/dev
/null
` &&
6915 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
6916 cmds=$old_archive_cmds
6918 # the command line is too long to link in one step, link in parts
6919 func_echo "using piecewise archive linking..."
6924 save_oldobjs=$oldobjs
6925 # Is there a better way of finding the last object in the list?
6926 for obj in $save_oldobjs
6930 for obj in $save_oldobjs
6932 oldobjs="$objlist $obj"
6933 objlist="$objlist $obj"
6934 eval test_cmds=\"$old_archive_cmds\"
6935 if len=`expr "X$test_cmds" : ".*" 2>/dev
/null
` &&
6936 test "$len" -le "$max_cmd_len"; then
6939 # the above command should be used before it gets too long
6941 if test "$obj" = "$last_oldobj" ; then
6944 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
6945 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
6951 if test "X$oldobjs" = "X" ; then
6952 eval cmds=\"\$concat_cmds\"
6954 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
6958 func_execute_cmds "$cmds" 'exit $?'
6961 test -n "$generated" && \
6962 func_show_eval "${RM}r$generated"
6964 # Now create the libtool archive.
6968 test "$build_old_libs" = yes && old_library="$libname.$libext"
6969 func_echo "creating $output"
6971 # Preserve any variables that may affect compiler behavior
6972 for var in $variables_saved_for_relink; do
6973 if eval test -z \"\${$var+set}\"; then
6974 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
6975 elif eval var_value=\$$var; test -z "$var_value"; then
6976 relink_command="$var=; export $var; $relink_command"
6978 func_quote_for_eval "$var_value"
6979 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
6982 # Quote the link command for shipping.
6983 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
6984 relink_command=`$ECHO "X$relink_command" |
$Xsed -e "$sed_quote_subst"`
6985 if test "$hardcode_automatic" = yes ; then
6989 # Only create the output if not a dry run.
6991 for installed in no yes; do
6992 if test "$installed" = yes; then
6993 if test -z "$install_libdir"; then
6996 output="$output_objdir/$outputname"i
6997 # Replace all uninstalled libtool libraries with the installed ones
6999 for deplib in $dependency_libs; do
7002 func_basename "$deplib"
7003 name="$func_basename_result"
7004 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
7005 test -z "$libdir" && \
7006 func_fatal_error "\`$deplib' is not a valid libtool archive"
7007 newdependency_libs="$newdependency_libs $libdir/$name"
7009 *) newdependency_libs="$newdependency_libs $deplib" ;;
7012 dependency_libs="$newdependency_libs"
7015 for lib in $dlfiles; do
7018 func_basename "$lib"
7019 name="$func_basename_result"
7020 eval libdir=`${SED} -n -e 's
/^libdir
=\
(.
*\
)$
/\
1/p
' $lib`
7021 test -z "$libdir" && \
7022 func_fatal_error "\`$lib' is not a valid libtool archive
"
7023 newdlfiles="$newdlfiles $libdir/$name"
7025 *) newdlfiles="$newdlfiles $lib" ;;
7028 dlfiles="$newdlfiles"
7030 for lib in $dlprefiles; do
7033 # Only pass preopened files to the pseudo-archive (for
7034 # eventual linking with the app. that links it) if we
7035 # didn't already link the preopened objects directly into
7037 func_basename "$lib"
7038 name="$func_basename_result"
7039 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
7040 test -z "$libdir" && \
7041 func_fatal_error "\
`$lib' is not a valid libtool archive"
7042 newdlprefiles="$newdlprefiles $libdir/$name"
7046 dlprefiles="$newdlprefiles"
7049 for lib in $dlfiles; do
7051 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
7052 *) abs=`pwd`"/$lib" ;;
7054 newdlfiles="$newdlfiles $abs"
7056 dlfiles="$newdlfiles"
7058 for lib in $dlprefiles; do
7060 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
7061 *) abs=`pwd`"/$lib" ;;
7063 newdlprefiles="$newdlprefiles $abs"
7065 dlprefiles="$newdlprefiles"
7068 # place dlname in correct position for cygwin
7070 case $host,$output,$installed,$module,$dlname in
7071 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
7074 # $outputname - a libtool library file
7075 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
7077 # Please DO NOT delete this file!
7078 # It is necessary for linking the library.
7080 # The name that we can dlopen(3).
7083 # Names of this library.
7084 library_names='$library_names'
7086 # The name of the static archive.
7087 old_library='$old_library'
7089 # Linker flags that can not go in dependency_libs.
7090 inherited_linker_flags='$new_inherited_linker_flags'
7092 # Libraries that this one depends upon.
7093 dependency_libs='$dependency_libs'
7095 # Names of additional weak libraries provided by this library
7096 weak_library_names='$weak_libs'
7098 # Version information for $libname.
7103 # Is this an already installed library?
7104 installed=$installed
7106 # Should we warn about portability when linking against -modules?
7107 shouldnotlink=$module
7109 # Files to dlopen/dlpreopen
7111 dlpreopen='$dlprefiles'
7113 # Directory that this library needs to be installed in:
7114 libdir='$install_libdir'"
7115 if test "$installed" = no && test "$need_relink" = yes; then
7117 relink_command=\"$relink_command\""
7122 # Do a symbolic link so that the libtool archive can be found in
7123 # LD_LIBRARY_PATH before the program is installed.
7124 func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
7131 # func_mode_uninstall arg...
7132 func_mode_uninstall ()
7140 # This variable tells wrapper scripts just to set variables rather
7141 # than running their programs.
7142 libtool_install_magic="$magic"
7147 -f) RM="$RM $arg"; rmforce=yes ;;
7148 -*) RM="$RM $arg" ;;
7149 *) files="$files $arg" ;;
7154 func_fatal_help "you must specify an RM program"
7158 origobjdir="$objdir"
7159 for file in $files; do
7160 func_dirname "$file" "" "."
7161 dir="$func_dirname_result"
7162 if test "X$dir" = X.; then
7163 objdir="$origobjdir"
7165 objdir="$dir/$origobjdir"
7167 func_basename "$file"
7168 name="$func_basename_result"
7169 test "$mode" = uninstall && objdir="$dir"
7171 # Remember objdir for removal later, being careful to avoid duplicates
7172 if test "$mode" = clean; then
7175 *) rmdirs="$rmdirs $objdir" ;;
7179 # Don't error if the file doesn't exist and rm -f was used.
7180 if { test -L "$file"; } >/dev/null 2>&1 ||
7181 { test -h "$file"; } >/dev/null 2>&1 ||
7182 test -f "$file"; then
7184 elif test -d "$file"; then
7187 elif test "$rmforce" = yes; then
7195 # Possibly a libtool archive, so verify it.
7196 if func_lalib_p "$file"; then
7199 # Delete the libtool libraries and symlinks.
7200 for n in $library_names; do
7201 rmfiles="$rmfiles $objdir/$n"
7203 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
7207 case " $library_names " in
7208 # " " in the beginning catches empty $dlname
7210 *) rmfiles="$rmfiles $objdir/$dlname" ;;
7212 test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
7215 if test -n "$library_names"; then
7216 # Do each command in the postuninstall commands.
7217 func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
7220 if test -n "$old_library"; then
7221 # Do each command in the old_postuninstall commands.
7222 func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
7224 # FIXME: should reinstall the best remaining shared library.
7231 # Possibly a libtool object, so verify it.
7232 if func_lalib_p "$file"; then
7237 # Add PIC object to the list of files to remove.
7238 if test -n "$pic_object" &&
7239 test "$pic_object" != none; then
7240 rmfiles="$rmfiles $dir/$pic_object"
7243 # Add non-PIC object to the list of files to remove.
7244 if test -n "$non_pic_object" &&
7245 test "$non_pic_object" != none; then
7246 rmfiles="$rmfiles $dir/$non_pic_object"
7252 if test "$mode" = clean ; then
7256 func_stripname '' '.exe' "$file"
7257 file=$func_stripname_result
7258 func_stripname '' '.exe' "$name"
7259 noexename=$func_stripname_result
7260 # $file with .exe has already been added to rmfiles,
7261 # add $file without .exe
7262 rmfiles="$rmfiles $file"
7265 # Do a test to see if this is a libtool program.
7266 if func_ltwrapper_p "$file"; then
7270 # note $name still contains .exe if it was in $file originally
7271 # as does the version of $file that was added into $rmfiles
7272 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
7273 if test "$fast_install" = yes && test -n "$relink_command"; then
7274 rmfiles="$rmfiles $objdir/lt-$name"
7276 if test "X$noexename" != "X$name" ; then
7277 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
7283 func_show_eval "$RM $rmfiles" 'exit_status=1'
7285 objdir="$origobjdir"
7287 # Try to remove the ${objdir}s in the directories where we deleted files
7288 for dir in $rmdirs; do
7289 if test -d "$dir"; then
7290 func_show_eval "rmdir $dir >/dev/null 2>&1"
7298 # TEST SUITE MARKER ## NON-FUNCTION
7304 # Sanity checks first:
7305 func_check_version_match
7307 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
7308 func_fatal_configuration "not configured to build any kind of library"
7311 test -z "$mode" && func_fatal_error "error: you must specify a MODE."
7315 eval std_shrext=\"$shrext_cmds\"
7318 # Only execute mode is allowed to have -dlopen flags.
7319 if test -n "$execute_dlfiles" && test "$mode" != execute; then
7320 func_error "unrecognized option \`-dlopen'"
7325 # Change the help message to a mode-specific one.
7326 generic_help="$help"
7327 help="Try \`$progname --help --mode=$mode' for more information.
"
7330 compile) func_mode_compile ${1+"$@"} ;;
7331 execute) func_mode_execute ${1+"$@"} ;;
7332 finish) func_mode_finish ${1+"$@"} ;;
7333 install) func_mode_install ${1+"$@"} ;;
7334 link|relink) func_mode_link ${1+"$@"} ;;
7335 uninstall|clean) func_mode_uninstall ${1+"$@"} ;;
7337 "") help="$generic_help"
7338 func_fatal_help "you must specify a MODE
"
7342 test -z "$exec_cmd" && \
7343 func_fatal_help "invalid operation mode \
`$mode'"
7345 if test -n "$exec_cmd"; then
7346 eval exec "$exec_cmd"
7354 # The TAGs below are defined such that we never get into a situation
7355 # in which we disable both kinds of libraries. Given conflicting
7356 # choices, we go for a static library, that is the most portable,
7357 # since we can't tell whether shared libraries were disabled because
7358 # the user asked for that or because the platform doesn't support
7359 # them. This is particularly important on AIX, because we don't
7360 # support having both static and shared libraries enabled at the same
7361 # time on that platform, so we default to a shared-only configuration.
7362 # If a disable-shared tag is given, we'll fallback to a static-only
7363 # configuration. But we'll never go from static-only to shared-only.
7365 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
7366 build_libtool_libs=no
7368 # ### END LIBTOOL TAG CONFIG: disable-shared
7370 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
7371 build_old_libs=`case $build_libtool_libs in yes) echo no
;; *) echo yes;; esac`
7372 # ### END LIBTOOL TAG CONFIG: disable-static