3 # libtool - Provide generalized library-building support services.
4 # Generated automatically by config.status (libgphoto2) 2.4.11
5 # Libtool was configured on host comdoc-desktop:
6 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
8 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
9 # 2006, 2007, 2008 Free Software Foundation, Inc.
10 # Written by Gordon Matzigkeit, 1996
12 # This file is part of GNU Libtool.
14 # GNU Libtool is free software; you can redistribute it and/or
15 # modify it under the terms of the GNU General Public License as
16 # published by the Free Software Foundation; either version 2 of
17 # the License, or (at your option) any later version.
19 # As a special exception to the GNU General Public License,
20 # if you distribute this file as part of a program or library that
21 # is built using GNU Libtool, you may include this file under the
22 # same distribution terms that you use for the rest of that program.
24 # GNU Libtool is distributed in the hope that it will be useful,
25 # but WITHOUT ANY WARRANTY; without even the implied warranty of
26 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 # GNU General Public License for more details.
29 # You should have received a copy of the GNU General Public License
30 # along with GNU Libtool; see the file COPYING. If not, a copy
31 # can be downloaded from http://www.gnu.org/licenses/gpl.html, or
32 # obtained by writing to the Free Software Foundation, Inc.,
33 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
36 # The names of the tagged configurations supported by this script.
39 # ### BEGIN LIBTOOL CONFIG
41 # Whether or not to build static libraries.
47 # DLL creation program.
50 # Object dumper program.
53 # Which release of libtool.m4 was used?
57 # Whether or not to build shared libraries.
58 build_libtool_libs=yes
60 # What type of objects to build.
63 # Whether or not to optimize for fast installation.
67 host_alias=armv7l-unknown-linux-gnueabi
68 host=armv7l-unknown-linux-gnueabi
72 build_alias=armv7l-unknown-linux-gnueabi
73 build=armv7l-unknown-linux-gnueabi
74 build_os=linux-gnueabi
76 # A sed program that does not truncate output.
79 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
80 Xsed="$SED -e 1s/^X//"
82 # A grep program that handles long lines.
88 # A literal string matcher.
91 # A BSD- or MS-compatible name lister.
94 # Whether we need soft or hard links.
97 # What is the maximum length of a command?
100 # Object file suffix (normally "o").
103 # Executable file suffix (normally "").
106 # whether the shell understands "unset".
109 # turn spaces into newlines.
110 SP2NL="tr \\040 \\012"
112 # turn newlines into spaces.
113 NL2SP="tr \\015\\012 \\040\\040"
115 # How to create reloadable object files.
117 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
119 # Method to check whether dependent libraries are shared objects.
120 deplibs_check_method="pass_all"
122 # Command to use when deplibs_check_method == "file_magic".
123 file_magic_cmd="\$MAGIC_CMD"
129 # A symbol stripping program.
132 # Commands used to install an old-style archive.
134 old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
135 old_postuninstall_cmds=""
140 # LTCC compiler flags.
141 LTCFLAGS=" -Wall -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -fmessage-length=0 -march=armv7-a -mtune=cortex-a8 -mlittle-endian -mfpu=vfpv3 -mfloat-abi=softfp -D__SOFTFP__ -fPIC -Wall -Wmissing-declarations -Wmissing-prototypes"
143 # Take the output of nm and produce a listing of raw symbols and C names.
144 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
146 # Transform the output of nm in a proper C declaration.
147 global_symbol_to_cdecl="sed -n -e 's/^T .* \\(.*\\)\$/extern int \\1();/p' -e 's/^[ABCDGIRSTW]* .* \\(.*\\)\$/extern char \\1;/p'"
149 # Transform the output of nm in a C name address pair.
150 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (void *) \\&\\2},/p'"
152 # Transform the output of nm in a C name address pair when lib prefix is needed.
153 global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\(lib[^ ]*\\)\$/ {\"\\2\", (void *) \\&\\2},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/ {\"lib\\2\", (void *) \\&\\2},/p'"
155 # The name of the directory that contains temporary libtool files.
158 # Shell to use when invoking shell scripts.
161 # An echo program that does not interpret backslashes.
164 # Used to examine libraries when file_magic_cmd begins with "file".
167 # Must we lock files when doing compilation?
170 # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
173 # Tool to change global to local symbols on Mac OS X.
176 # Tool to manipulate fat objects and archives on Mac OS X.
179 # ldd/readelf like tool for Mach-O binaries on Mac OS X.
182 # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
185 # Old archive suffix (normally "a").
188 # Shared library suffix (normally ".so").
191 # The commands to extract the exported symbol list from a shared archive.
192 extract_expsyms_cmds=""
194 # Variables whose values should be saved in libtool wrapper scripts and
195 # restored at link time.
196 variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
198 # Do we need the "lib" prefix for modules?
201 # Do we need a version for libraries?
204 # Library versioning type.
207 # Shared library runtime path variable.
208 runpath_var=LD_RUN_PATH
210 # Shared library path variable.
211 shlibpath_var=LD_LIBRARY_PATH
213 # Is shlibpath searched before the hard-coded library search path?
214 shlibpath_overrides_runpath=no
216 # Format of library name prefix.
217 libname_spec="lib\$name"
219 # List of archive names. First name is the real one, the rest are links.
220 # The last name is the one that the linker finds with -lNAME
221 library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
223 # The coded name of the library, if different from the real name.
224 soname_spec="\${libname}\${release}\${shared_ext}\$major"
226 # Command to use after installation of a shared archive.
229 # Command to use after uninstallation of a shared archive.
230 postuninstall_cmds=""
232 # Commands used to finish a libtool library installation in a directory.
233 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
235 # As "finish_cmds", except a single script fragment to be evaled but
239 # Whether we should hardcode library paths into libraries.
240 hardcode_into_libs=yes
242 # Compile-time system search path for libraries.
243 sys_lib_search_path_spec="/usr/lib/gcc/armv7l-tizen-linux-gnueabi/4.5.3 /lib /usr/lib"
245 # Run-time system search path for libraries.
246 sys_lib_dlsearch_path_spec="/lib /usr/lib /emul/ia32-linux/usr/i586-tizen-linux/lib /emul/ia32-linux/usr/local/lib /emul/ia32-linux/lib /emul/ia32-linux/usr/lib "
248 # Whether dlopen is supported.
251 # Whether dlopen of programs is supported.
254 # Whether dlopen of statically linked programs is supported.
255 dlopen_self_static=yes
257 # Commands to strip libraries.
258 old_striplib="strip --strip-debug"
259 striplib="strip --strip-unneeded"
262 # The linker used to build libraries.
263 LD="/usr/libexec/gcc/armv7l-tizen-linux-gnueabi/4.5.3/ld"
265 # Commands used to build an old-style archive.
266 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
268 # A language specific compiler.
271 # Is the compiler the GNU compiler?
274 # Compiler flag to turn off builtin functions.
275 no_builtin_flag=" -fno-builtin"
277 # How to pass a linker flag through the compiler.
280 # Additional compiler flags for building library objects.
281 pic_flag=" -fPIC -DPIC"
283 # Compiler flag to prevent dynamic linking.
286 # Does compiler simultaneously support -c and -o options?
289 # Whether or not to add -lc for building shared libraries.
290 build_libtool_need_lc=no
292 # Whether or not to disallow shared libs when runtime libs are static.
293 allow_libtool_libs_with_static_runtimes=no
295 # Compiler flag to allow reflexive dlopens.
296 export_dynamic_flag_spec="\${wl}--export-dynamic"
298 # Compiler flag to generate shared objects directly from archives.
299 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
301 # Whether the compiler copes with passing no objects directly.
302 compiler_needs_object="no"
304 # Create an old-style archive from a shared archive.
305 old_archive_from_new_cmds=""
307 # Create a temporary old-style archive to link instead of a shared archive.
308 old_archive_from_expsyms_cmds=""
310 # Commands used to build a shared archive.
311 archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
312 archive_expsym_cmds="echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
313 cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
314 echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
315 \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
317 # Commands used to build a loadable module if different from building
320 module_expsym_cmds=""
322 # Whether we are building with GNU ld or not.
325 # Flag that allows shared libraries with undefined symbols to be built.
326 allow_undefined_flag=""
328 # Flag that enforces no undefined symbols.
331 # Flag to hardcode $libdir into a binary during linking.
332 # This must work even if $libdir does not exist
333 hardcode_libdir_flag_spec="\${wl}-rpath \${wl}\$libdir"
335 # If ld is used when linking, flag to hardcode $libdir into a binary
336 # during linking. This must work even if $libdir does not exist.
337 hardcode_libdir_flag_spec_ld=""
339 # Whether we need a single "-rpath" flag with a separated argument.
340 hardcode_libdir_separator=""
342 # Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
343 # DIR into the resulting binary.
346 # Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
347 # DIR into the resulting binary and the resulting library dependency is
348 # "absolute",i.e impossible to change by setting ${shlibpath_var} if the
349 # library is relocated.
350 hardcode_direct_absolute=no
352 # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
353 # into the resulting binary.
356 # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
357 # into the resulting binary.
358 hardcode_shlibpath_var=unsupported
360 # Set to "yes" if building a shared library automatically hardcodes DIR
361 # into the library and all subsequent libraries and executables linked
363 hardcode_automatic=no
365 # Set to yes if linker adds runtime paths of dependent libraries
366 # to runtime path list.
369 # Whether libtool must link a program against all its dependency libraries.
372 # Fix the shell variable $srcfile for the compiler.
375 # Set to "yes" if exported symbols are required.
376 always_export_symbols=no
378 # The commands to list exported symbols.
379 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
381 # Symbols that should not be listed in the preloaded symbols.
382 exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
384 # Symbols that must always be exported.
387 # Commands necessary for linking programs (against libraries) with templates.
390 # Specify filename containing input files.
393 # How to hardcode a shared library path into an executable.
394 hardcode_action=immediate
396 # The directories searched by this compiler when creating a shared library.
397 compiler_lib_search_dirs=""
399 # Dependencies to place before and after the objects being linked to
400 # create a shared library.
406 # The library search path used internally by the compiler when linking
408 compiler_lib_search_path=""
410 # ### END LIBTOOL CONFIG
412 # Generated from ltmain.m4sh.
414 # ltmain.sh (GNU libtool) 2.2.6b
415 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
417 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
418 # This is free software; see the source for copying conditions. There is NO
419 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
421 # GNU Libtool is free software; you can redistribute it and/or modify
422 # it under the terms of the GNU General Public License as published by
423 # the Free Software Foundation; either version 2 of the License, or
424 # (at your option) any later version.
426 # As a special exception to the GNU General Public License,
427 # if you distribute this file as part of a program or library that
428 # is built using GNU Libtool, you may include this file under the
429 # same distribution terms that you use for the rest of that program.
431 # GNU Libtool is distributed in the hope that it will be useful, but
432 # WITHOUT ANY WARRANTY; without even the implied warranty of
433 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
434 # General Public License for more details.
436 # You should have received a copy of the GNU General Public License
437 # along with GNU Libtool; see the file COPYING. If not, a copy
438 # can be downloaded from http://www.gnu.org/licenses/gpl.html,
439 # or obtained by writing to the Free Software Foundation, Inc.,
440 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
442 # Usage: $progname [OPTION]... [MODE-ARG]...
444 # Provide generalized library-building support services.
446 # --config show all configuration variables
447 # --debug enable verbose shell tracing
448 # -n, --dry-run display commands without modifying any files
449 # --features display basic configuration information and exit
450 # --mode=MODE use operation mode MODE
451 # --preserve-dup-deps don't remove duplicate dependency libraries
452 # --quiet, --silent don't print informational messages
453 # --tag=TAG use configuration variables from tag TAG
454 # -v, --verbose print informational messages (default)
455 # --version print version information
456 # -h, --help print short or long help message
458 # MODE must be one of the following:
460 # clean remove files from the build directory
461 # compile compile a source file into a libtool object
462 # execute automatically set library path, then run a program
463 # finish complete the installation of libtool libraries
464 # install install libraries or executables
465 # link create a library or an executable
466 # uninstall remove libraries from an installed directory
468 # MODE-ARGS vary depending on the MODE.
469 # Try `$progname --help --mode=MODE' for a more detailed description of MODE.
471 # When reporting a bug, please describe a test case to reproduce it and
472 # include the following information:
474 # host-triplet: $host
477 # compiler flags: $LTCFLAGS
478 # linker: $LD (gnu? $with_gnu_ld)
479 # $progname: (GNU libtool) 2.2.6b Debian-2.2.6b-2
480 # automake: $automake_version
481 # autoconf: $autoconf_version
483 # Report bugs to <bug-libtool@gnu.org>.
487 VERSION="2.2.6b Debian-2.2.6b-2"
489 package_revision=1.3017
491 # Be Bourne compatible
492 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
495 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
496 # is contrary to our usage. Disable this feature.
497 alias -g '${1+"$@"}'='"$@"'
500 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
502 BIN_SH=xpg4; export BIN_SH # for Tru64
503 DUALCASE=1; export DUALCASE # for MKS sh
505 # NLS nuisances: We save the old values to restore during execute mode.
506 # Only set LANG and LC_ALL to C if already set.
507 # These must not be set unconditionally because not all systems understand
508 # e.g. LANG=C (notably SCO).
511 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
513 eval "if test \"\${$lt_var+set}\" = set; then
514 save_$lt_var=\$$lt_var
517 lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
518 lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
530 : ${EGREP="/bin/grep -E"}
531 : ${FGREP="/bin/grep -F"}
532 : ${GREP="/bin/grep"}
539 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
540 : ${Xsed="$SED -e 1s/^X//"}
545 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
546 EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
548 exit_status=$EXIT_SUCCESS
550 # Make sure IFS has a sensible default
555 dirname="s,/[^/]*$,,"
558 # func_dirname_and_basename file append nondir_replacement
559 # perform func_basename and func_dirname in a single function
561 # dirname: Compute the dirname of FILE. If nonempty,
562 # add APPEND to the result, otherwise set result
563 # to NONDIR_REPLACEMENT.
564 # value returned in "$func_dirname_result"
565 # basename: Compute filename of FILE.
566 # value retuned in "$func_basename_result"
567 # Implementation must be kept synchronized with func_dirname
568 # and func_basename. For efficiency, we do not delegate to
569 # those functions but instead duplicate the functionality here.
570 func_dirname_and_basename ()
572 # Extract subdirectory from the argument.
573 func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
574 if test "X$func_dirname_result" = "X${1}"; then
575 func_dirname_result="${3}"
577 func_dirname_result="$func_dirname_result${2}"
579 func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
582 # Generated shell functions inserted here.
584 # func_dirname file append nondir_replacement
585 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
586 # otherwise set result to NONDIR_REPLACEMENT.
590 */*) func_dirname_result="${1%/*}${2}" ;;
591 * ) func_dirname_result="${3}" ;;
598 func_basename_result="${1##*/}"
601 # func_dirname_and_basename file append nondir_replacement
602 # perform func_basename and func_dirname in a single function
604 # dirname: Compute the dirname of FILE. If nonempty,
605 # add APPEND to the result, otherwise set result
606 # to NONDIR_REPLACEMENT.
607 # value returned in "$func_dirname_result"
608 # basename: Compute filename of FILE.
609 # value retuned in "$func_basename_result"
610 # Implementation must be kept synchronized with func_dirname
611 # and func_basename. For efficiency, we do not delegate to
612 # those functions but instead duplicate the functionality here.
613 func_dirname_and_basename ()
616 */*) func_dirname_result="${1%/*}${2}" ;;
617 * ) func_dirname_result="${3}" ;;
619 func_basename_result="${1##*/}"
622 # func_stripname prefix suffix name
623 # strip PREFIX and SUFFIX off of NAME.
624 # PREFIX and SUFFIX must not contain globbing or regex special
625 # characters, hashes, percent signs, but SUFFIX may contain a leading
626 # dot (in which case that matches only a dot).
629 # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
630 # positional parameters, so assign one to ordinary parameter first.
631 func_stripname_result=${3}
632 func_stripname_result=${func_stripname_result#"${1}"}
633 func_stripname_result=${func_stripname_result%"${2}"}
639 func_opt_split_opt=${1%%=*}
640 func_opt_split_arg=${1#*=}
647 *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
648 *) func_lo2o_result=${1} ;;
652 # func_xform libobj-or-source
655 func_xform_result=${1%.*}.lo
658 # func_arith arithmetic-term...
661 func_arith_result=$(( $* ))
665 # STRING may not start with a hyphen.
668 func_len_result=${#1}
672 # func_append var value
673 # Append VALUE to the end of shell variable VAR.
678 # Generated shell functions inserted here.
680 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
681 # is ksh but when the shell is invoked as "sh" and the current value of
682 # the _XPG environment variable is not equal to 1 (one), the special
683 # positional parameter $0, within a function call, is the name of the
687 # The name of this program:
688 # In the unlikely event $progname began with a '-', it would play havoc with
689 # func_echo (imagine progname=-n), so we prepend ./ in that case:
690 func_dirname_and_basename "$progpath"
691 progname=$func_basename_result
693 -*) progname=./$progname ;;
696 # Make sure we have an absolute path for reexecution:
698 [\\/]*|[A-Za-z]:\\*) ;;
700 progdir=$func_dirname_result
701 progdir=`cd "$progdir" && pwd`
702 progpath="$progdir/$progname"
707 for progdir in $PATH; do
709 test -x "$progdir/$progname" && break
712 test -n "$progdir" || progdir=`pwd`
713 progpath="$progdir/$progname"
717 # Sed substitution that helps us do robust quoting. It backslashifies
718 # metacharacters that are still active within double-quoted strings.
719 Xsed="${SED}"' -e 1s/^X//'
720 sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
722 # Same as above, but do not quote variable references.
723 double_quote_subst='s/\(["`\\]\)/\\\1/g'
725 # Re-`\' parameter expansions in output of double_quote_subst that were
726 # `\'-ed in input to the same. If an odd number of `\' preceded a '$'
727 # in input to double_quote_subst, that '$' was protected from expansion.
728 # Since each input `\' is now two `\'s, look for any number of runs of
729 # four `\'s followed by two `\'s and then a '$'. `\' that '$'.
734 sed_double_backslash="\
738 s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
749 # Echo program name prefixed message, along with the current mode
750 # name if it has been set yet.
753 $ECHO "$progname${mode+: }$mode: $*"
756 # func_verbose arg...
757 # Echo program name prefixed message in verbose mode only.
760 $opt_verbose && func_echo ${1+"$@"}
762 # A bug in bash halts the script if the last line of a function
763 # fails when set -e is in force, so we need another command to
769 # Echo program name prefixed message to standard error.
772 $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
775 # func_warning arg...
776 # Echo program name prefixed warning message to standard error.
779 $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
785 # func_fatal_error arg...
786 # Echo program name prefixed message to standard error, and exit.
793 # func_fatal_help arg...
794 # Echo program name prefixed message to standard error, followed by
795 # a help hint, and exit.
799 func_fatal_error "$help"
801 help="Try \`$progname --help' for more information." ## default
804 # func_grep expression filename
805 # Check whether EXPRESSION matches any line of FILENAME, without output.
808 $GREP "$1" "$2" >/dev/null 2>&1
812 # func_mkdir_p directory-path
813 # Make sure the entire path to DIRECTORY-PATH is available.
816 my_directory_path="$1"
819 if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
821 # Protect directory names starting with `-'
822 case $my_directory_path in
823 -*) my_directory_path="./$my_directory_path" ;;
826 # While some portion of DIR does not yet exist...
827 while test ! -d "$my_directory_path"; do
828 # ...make a list in topmost first order. Use a colon delimited
829 # list incase some portion of path contains whitespace.
830 my_dir_list="$my_directory_path:$my_dir_list"
832 # If the last portion added has no slash in it, the list is done
833 case $my_directory_path in */*) ;; *) break ;; esac
835 # ...otherwise throw away the child directory and loop
836 my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
838 my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
840 save_mkdir_p_IFS="$IFS"; IFS=':'
841 for my_dir in $my_dir_list; do
842 IFS="$save_mkdir_p_IFS"
843 # mkdir can fail with a `File exist' error if two processes
844 # try to create one of the directories concurrently. Don't
846 $MKDIR "$my_dir" 2>/dev/null || :
848 IFS="$save_mkdir_p_IFS"
850 # Bail out if we (or some other process) failed to create a directory.
851 test -d "$my_directory_path" || \
852 func_fatal_error "Failed to create \`$1'"
857 # func_mktempdir [string]
858 # Make a temporary directory that won't clash with other running
859 # libtool processes, and avoids race conditions if possible. If
860 # given, STRING is the basename for that directory.
863 my_template="${TMPDIR-/tmp}/${1-$progname}"
865 if test "$opt_dry_run" = ":"; then
866 # Return a directory name, but don't create it in dry-run mode
867 my_tmpdir="${my_template}-$$"
870 # If mktemp works, use that first and foremost
871 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
873 if test ! -d "$my_tmpdir"; then
874 # Failing that, at least try and use $RANDOM to avoid a race
875 my_tmpdir="${my_template}-${RANDOM-0}$$"
877 save_mktempdir_umask=`umask`
880 umask $save_mktempdir_umask
883 # If we're not in dry-run mode, bomb out on failure
884 test -d "$my_tmpdir" || \
885 func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
888 $ECHO "X$my_tmpdir" | $Xsed
892 # func_quote_for_eval arg
893 # Aesthetically quote ARG to be evaled later.
894 # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
895 # is double-quoted, suitable for a subsequent eval, whereas
896 # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
897 # which are still active within double quotes backslashified.
898 func_quote_for_eval ()
902 func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
904 func_quote_for_eval_unquoted_result="$1" ;;
907 case $func_quote_for_eval_unquoted_result in
908 # Double-quote args containing shell metacharacters to delay
909 # word splitting, command substitution and and variable
910 # expansion for a subsequent eval.
911 # Many Bourne shells cannot handle close brackets correctly
912 # in scan sets, so we specify it separately.
913 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
914 func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
917 func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
922 # func_quote_for_expand arg
923 # Aesthetically quote ARG to be evaled later; same as above,
924 # but do not quote variable references.
925 func_quote_for_expand ()
929 my_arg=`$ECHO "X$1" | $Xsed \
930 -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
936 # Double-quote args containing shell metacharacters to delay
937 # word splitting and command substitution for a subsequent eval.
938 # Many Bourne shells cannot handle close brackets correctly
939 # in scan sets, so we specify it separately.
940 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
945 func_quote_for_expand_result="$my_arg"
949 # func_show_eval cmd [fail_exp]
950 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
951 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
952 # is given, then evaluate it.
958 ${opt_silent-false} || {
959 func_quote_for_expand "$my_cmd"
960 eval "func_echo $func_quote_for_expand_result"
963 if ${opt_dry_run-false}; then :; else
966 if test "$my_status" -eq 0; then :; else
967 eval "(exit $my_status); $my_fail_exp"
973 # func_show_eval_locale cmd [fail_exp]
974 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
975 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
976 # is given, then evaluate it. Use the saved locale for evaluation.
977 func_show_eval_locale ()
982 ${opt_silent-false} || {
983 func_quote_for_expand "$my_cmd"
984 eval "func_echo $func_quote_for_expand_result"
987 if ${opt_dry_run-false}; then :; else
988 eval "$lt_user_locale
991 eval "$lt_safe_locale"
992 if test "$my_status" -eq 0; then :; else
993 eval "(exit $my_status); $my_fail_exp"
1003 # Echo version message to standard output and exit.
1006 $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
1009 s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
1016 # Echo short help message to standard output and exit.
1019 $SED -n '/^# Usage:/,/# -h/ {
1022 s/\$progname/'$progname'/
1026 $ECHO "run \`$progname --help | more' for full usage"
1031 # Echo long help message to standard output and exit.
1034 $SED -n '/^# Usage:/,/# Report bugs to/ {
1037 s*\$progname*'$progname'*
1039 s*\$SHELL*'"$SHELL"'*
1041 s*\$LTCFLAGS*'"$LTCFLAGS"'*
1043 s/\$with_gnu_ld/'"$with_gnu_ld"'/
1044 s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
1045 s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
1051 # func_missing_arg argname
1052 # Echo program name prefixed message to standard error and set global
1056 func_error "missing argument for $1"
1066 # Check that we have a working $ECHO.
1067 if test "X$1" = X--no-reexec; then
1068 # Discard the --no-reexec flag, and continue.
1070 elif test "X$1" = X--fallback-echo; then
1071 # Avoid inline document here, it may be left over
1073 elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
1074 # Yippee, $ECHO works!
1077 # Restart under the correct shell, and then maybe $ECHO will work.
1078 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
1081 if test "X$1" = X--fallback-echo; then
1082 # used as fallback echo
1090 magic="%%%MAGIC variable%%%"
1091 magic_exe="%%%MAGIC EXE variable%%%"
1098 lo2o="s/\\.lo\$/.${objext}/"
1099 o2lo="s/\\.${objext}\$/.lo/"
1104 opt_duplicate_deps=false
1108 # If this variable is set in any of the actions, the command in it
1109 # will be execed at the end. This prevents here-documents from being
1110 # left over by shells.
1113 # func_fatal_configuration arg...
1114 # Echo program name prefixed message to standard error, followed by
1115 # a configuration failure hint, and exit.
1116 func_fatal_configuration ()
1118 func_error ${1+"$@"}
1119 func_error "See the $PACKAGE documentation for more information."
1120 func_fatal_error "Fatal configuration error."
1125 # Display the configuration for all the tags in this script.
1128 re_begincf='^# ### BEGIN LIBTOOL'
1129 re_endcf='^# ### END LIBTOOL'
1131 # Default configuration.
1132 $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
1134 # Now print the configurations for the tags.
1135 for tagname in $taglist; do
1136 $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
1143 # Display the features supported by this script.
1147 if test "$build_libtool_libs" = yes; then
1148 $ECHO "enable shared libraries"
1150 $ECHO "disable shared libraries"
1152 if test "$build_old_libs" = yes; then
1153 $ECHO "enable static libraries"
1155 $ECHO "disable static libraries"
1161 # func_enable_tag tagname
1162 # Verify that TAGNAME is valid, and either flag an error and exit, or
1163 # enable the TAGNAME tag. We also add TAGNAME to the global $taglist
1170 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
1171 re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
1172 sed_extractcf="/$re_begincf/,/$re_endcf/p"
1177 func_fatal_error "invalid tag name: $tagname"
1181 # Don't test for the "default" C tag, as we know it's
1182 # there but not specially marked.
1186 if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
1187 taglist="$taglist $tagname"
1189 # Evaluate the configuration. Be careful to quote the path
1190 # and the sed script, to avoid splitting on whitespace, but
1191 # also don't use non-portable quotes within backquotes within
1192 # quotes we have to do it in 2 steps:
1193 extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
1196 func_error "ignoring unknown tag $tagname"
1202 # Parse options once, thoroughly. This comes as soon as possible in
1203 # the script to make things like `libtool --version' happen quickly.
1206 # Shorthand for --mode=foo, only valid as the first argument
1209 shift; set dummy --mode clean ${1+"$@"}; shift
1211 compile|compil|compi|comp|com|co|c)
1212 shift; set dummy --mode compile ${1+"$@"}; shift
1214 execute|execut|execu|exec|exe|ex|e)
1215 shift; set dummy --mode execute ${1+"$@"}; shift
1217 finish|finis|fini|fin|fi|f)
1218 shift; set dummy --mode finish ${1+"$@"}; shift
1220 install|instal|insta|inst|ins|in|i)
1221 shift; set dummy --mode install ${1+"$@"}; shift
1224 shift; set dummy --mode link ${1+"$@"}; shift
1226 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
1227 shift; set dummy --mode uninstall ${1+"$@"}; shift
1231 # Parse non-mode specific arguments:
1232 while test "$#" -gt 0; do
1237 --config) func_config ;;
1239 --debug) preserve_args="$preserve_args $opt"
1240 func_echo "enabling shell trace mode"
1245 -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break
1246 execute_dlfiles="$execute_dlfiles $1"
1250 --dry-run | -n) opt_dry_run=: ;;
1251 --features) func_features ;;
1252 --finish) mode="finish" ;;
1254 --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break
1256 # Valid mode arguments:
1266 # Catch anything else as an error
1267 *) func_error "invalid argument for $opt"
1277 --preserve-dup-deps)
1278 opt_duplicate_deps=: ;;
1280 --quiet|--silent) preserve_args="$preserve_args $opt"
1284 --verbose| -v) preserve_args="$preserve_args $opt"
1288 --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break
1289 preserve_args="$preserve_args $opt $1"
1290 func_enable_tag "$1" # tagname is set here
1294 # Separate optargs to long options:
1295 -dlopen=*|--mode=*|--tag=*)
1296 func_opt_split "$opt"
1297 set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
1301 -\?|-h) func_usage ;;
1302 --help) opt_help=: ;;
1303 --version) func_version ;;
1305 -*) func_fatal_help "unrecognized option \`$opt'" ;;
1315 *cygwin* | *mingw* | *pw32* | *cegcc*)
1316 # don't eliminate duplications in $postdeps and $predeps
1317 opt_duplicate_compiler_generated_deps=:
1320 opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
1324 # Having warned about all mis-specified options, bail out if
1325 # anything was wrong.
1326 $exit_cmd $EXIT_FAILURE
1329 # func_check_version_match
1330 # Ensure that we are using m4 macros, and libtool script from the same
1331 # release of libtool.
1332 func_check_version_match ()
1334 if test "$package_revision" != "$macro_revision"; then
1335 if test "$VERSION" != "$macro_version"; then
1336 if test -z "$macro_version"; then
1338 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
1339 $progname: definition of this LT_INIT comes from an older release.
1340 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1341 $progname: and run autoconf again.
1345 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
1346 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
1347 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1348 $progname: and run autoconf again.
1353 $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
1354 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
1355 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
1356 $progname: of $PACKAGE $VERSION and run autoconf again.
1370 # Sanity checks first:
1371 func_check_version_match
1373 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1374 func_fatal_configuration "not configured to build any kind of library"
1377 test -z "$mode" && func_fatal_error "error: you must specify a MODE."
1381 eval std_shrext=\"$shrext_cmds\"
1384 # Only execute mode is allowed to have -dlopen flags.
1385 if test -n "$execute_dlfiles" && test "$mode" != execute; then
1386 func_error "unrecognized option \`-dlopen'"
1391 # Change the help message to a mode-specific one.
1392 generic_help="$help"
1393 help="Try \`$progname --help --mode=$mode' for more information."
1398 # True iff FILE is a libtool `.la' library or `.lo' object file.
1399 # This function is only a basic sanity check; it will hardly flush out
1400 # determined imposters.
1404 $SED -e 4q "$1" 2>/dev/null \
1405 | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
1408 # func_lalib_unsafe_p file
1409 # True iff FILE is a libtool `.la' library or `.lo' object file.
1410 # This function implements the same check as func_lalib_p without
1411 # resorting to external programs. To this end, it redirects stdin and
1412 # closes it afterwards, without saving the original file descriptor.
1413 # As a safety measure, use it only where a negative result would be
1414 # fatal anyway. Works if `file' does not exist.
1415 func_lalib_unsafe_p ()
1418 if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
1419 for lalib_p_l in 1 2 3 4
1422 case "$lalib_p_line" in
1423 \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
1428 test "$lalib_p" = yes
1431 # func_ltwrapper_script_p file
1432 # True iff FILE is a libtool wrapper script
1433 # This function is only a basic sanity check; it will hardly flush out
1434 # determined imposters.
1435 func_ltwrapper_script_p ()
1440 # func_ltwrapper_executable_p file
1441 # True iff FILE is a libtool wrapper executable
1442 # This function is only a basic sanity check; it will hardly flush out
1443 # determined imposters.
1444 func_ltwrapper_executable_p ()
1446 func_ltwrapper_exec_suffix=
1449 *) func_ltwrapper_exec_suffix=.exe ;;
1451 $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
1454 # func_ltwrapper_scriptname file
1455 # Assumes file is an ltwrapper_executable
1456 # uses $file to determine the appropriate filename for a
1457 # temporary ltwrapper_script.
1458 func_ltwrapper_scriptname ()
1460 func_ltwrapper_scriptname_result=""
1461 if func_ltwrapper_executable_p "$1"; then
1462 func_dirname_and_basename "$1" "" "."
1463 func_stripname '' '.exe' "$func_basename_result"
1464 func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
1468 # func_ltwrapper_p file
1469 # True iff FILE is a libtool wrapper script or wrapper executable
1470 # This function is only a basic sanity check; it will hardly flush out
1471 # determined imposters.
1474 func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
1478 # func_execute_cmds commands fail_cmd
1479 # Execute tilde-delimited COMMANDS.
1480 # If FAIL_CMD is given, eval that upon failure.
1481 # FAIL_CMD may read-access the current command in variable CMD!
1482 func_execute_cmds ()
1485 save_ifs=$IFS; IFS='~'
1489 func_show_eval "$cmd" "${2-:}"
1496 # Source FILE, adding directory component if necessary.
1497 # Note that it is not necessary on cygwin/mingw to append a dot to
1498 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
1499 # behavior happens only for exec(3), not for open(2)! Also, sourcing
1500 # `FILE.' does not work on cygwin managed mounts.
1505 */* | *\\*) . "$1" ;;
1511 # func_infer_tag arg
1512 # Infer tagged configuration to use if any are available and
1513 # if one wasn't chosen via the "--tag" command line option.
1514 # Only attempt this if the compiler in the base compile
1515 # command doesn't match the default compiler.
1516 # arg is usually of the form 'gcc ...'
1520 if test -n "$available_tags" && test -z "$tagname"; then
1523 func_quote_for_eval "$arg"
1524 CC_quoted="$CC_quoted $func_quote_for_eval_result"
1527 # Blanks in the command may have been stripped by the calling shell,
1528 # but not from the CC environment variable when configure was run.
1529 " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
1530 # Blanks at the start of $base_compile will cause this to fail
1531 # if we don't check for them as well.
1533 for z in $available_tags; do
1534 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
1535 # Evaluate the configuration.
1536 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1539 # Double-quote args containing other shell metacharacters.
1540 func_quote_for_eval "$arg"
1541 CC_quoted="$CC_quoted $func_quote_for_eval_result"
1544 " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
1545 # The compiler in the base compile command matches
1546 # the one in the tagged configuration.
1547 # Assume this is the tagged configuration we want.
1554 # If $tagname still isn't set, then no tagged configuration
1555 # was found and let the user know that the "--tag" command
1556 # line option must be used.
1557 if test -z "$tagname"; then
1558 func_echo "unable to infer tagged configuration"
1559 func_fatal_error "specify a tag with \`--tag'"
1561 # func_verbose "using $tagname tagged configuration"
1570 # func_write_libtool_object output_name pic_name nonpic_name
1571 # Create a libtool object file (analogous to a ".la" file),
1572 # but don't create it if we're doing a dry run.
1573 func_write_libtool_object ()
1576 if test "$build_libtool_libs" = yes; then
1582 if test "$build_old_libs" = yes; then
1583 write_oldobj=\'${3}\'
1589 cat >${write_libobj}T <<EOF
1590 # $write_libobj - a libtool object file
1591 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
1593 # Please DO NOT delete this file!
1594 # It is necessary for linking the library.
1596 # Name of the PIC object.
1597 pic_object=$write_lobj
1599 # Name of the non-PIC object
1600 non_pic_object=$write_oldobj
1603 $MV "${write_libobj}T" "${write_libobj}"
1607 # func_mode_compile arg...
1608 func_mode_compile ()
1611 # Get the compilation command and the source file.
1613 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
1625 # do not "continue". Instead, add this to base_compile
1637 # Accept any command-line options.
1640 test -n "$libobj" && \
1641 func_fatal_error "you cannot specify \`-o' more than once"
1646 -pie | -fpie | -fPIE)
1647 pie_flag="$pie_flag $arg"
1651 -shared | -static | -prefer-pic | -prefer-non-pic)
1662 arg_mode=arg # the next one goes into the "base_compile" arg list
1663 continue # The current "srcfile" will either be retained or
1664 ;; # replaced later. I would guess that would be a bug.
1667 func_stripname '-Wc,' '' "$arg"
1668 args=$func_stripname_result
1670 save_ifs="$IFS"; IFS=','
1671 for arg in $args; do
1673 func_quote_for_eval "$arg"
1674 lastarg="$lastarg $func_quote_for_eval_result"
1677 func_stripname ' ' '' "$lastarg"
1678 lastarg=$func_stripname_result
1680 # Add the arguments to base_compile.
1681 base_compile="$base_compile $lastarg"
1686 # Accept the current argument as the source file.
1687 # The previous "srcfile" becomes the current argument.
1694 esac # case $arg_mode
1696 # Aesthetically quote the previous argument.
1697 func_quote_for_eval "$lastarg"
1698 base_compile="$base_compile $func_quote_for_eval_result"
1703 func_fatal_error "you must specify an argument for -Xcompile"
1706 func_fatal_error "you must specify a target with \`-o'"
1709 # Get the name of the library object.
1710 test -z "$libobj" && {
1711 func_basename "$srcfile"
1712 libobj="$func_basename_result"
1717 # Recognize several different file suffixes.
1718 # If the user specifies -o file.o, it is replaced with file.lo
1721 *.ada | *.adb | *.ads | *.asm | \
1722 *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
1723 *.[fF][09]? | *.for | *.java | *.obj | *.sx)
1724 func_xform "$libobj"
1725 libobj=$func_xform_result
1730 *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
1732 func_fatal_error "cannot determine name of library object from \`$libobj'"
1736 func_infer_tag $base_compile
1738 for arg in $later; do
1741 test "$build_libtool_libs" != yes && \
1742 func_fatal_configuration "can not build a shared library"
1748 build_libtool_libs=no
1765 func_quote_for_eval "$libobj"
1766 test "X$libobj" != "X$func_quote_for_eval_result" \
1767 && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
1768 && func_warning "libobj name \`$libobj' may not contain shell special characters."
1769 func_dirname_and_basename "$obj" "/" ""
1770 objname="$func_basename_result"
1771 xdir="$func_dirname_result"
1772 lobj=${xdir}$objdir/$objname
1774 test -z "$base_compile" && \
1775 func_fatal_help "you must specify a compilation command"
1777 # Delete any leftover library objects.
1778 if test "$build_old_libs" = yes; then
1779 removelist="$obj $lobj $libobj ${libobj}T"
1781 removelist="$lobj $libobj ${libobj}T"
1784 # On Cygwin there's no "real" PIC flag so we must build both object types
1786 cygwin* | mingw* | pw32* | os2* | cegcc*)
1790 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
1791 # non-PIC code in shared libraries is not supported
1795 # Calculate the filename of the output object if compiler does
1796 # not support -o with -c
1797 if test "$compiler_c_o" = no; then
1798 output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
1799 lockfile="$output_obj.lock"
1806 # Lock this critical section if it is needed
1807 # We use this script file to make the link, it avoids creating a new file
1808 if test "$need_locks" = yes; then
1809 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
1810 func_echo "Waiting for $lockfile to be removed"
1813 elif test "$need_locks" = warn; then
1814 if test -f "$lockfile"; then
1816 *** ERROR, $lockfile exists and contains:
1817 `cat $lockfile 2>/dev/null`
1819 This indicates that another process is trying to use the same
1820 temporary object file, and libtool could not work around it because
1821 your compiler does not support \`-c' and \`-o' together. If you
1822 repeat this compilation, it may succeed, by chance, but you had better
1823 avoid parallel builds (make -j) in this platform, or get a better
1826 $opt_dry_run || $RM $removelist
1829 removelist="$removelist $output_obj"
1830 $ECHO "$srcfile" > "$lockfile"
1833 $opt_dry_run || $RM $removelist
1834 removelist="$removelist $lockfile"
1835 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
1837 if test -n "$fix_srcfile_path"; then
1838 eval srcfile=\"$fix_srcfile_path\"
1840 func_quote_for_eval "$srcfile"
1841 qsrcfile=$func_quote_for_eval_result
1843 # Only build a PIC object if we are building libtool libraries.
1844 if test "$build_libtool_libs" = yes; then
1845 # Without this assignment, base_compile gets emptied.
1846 fbsd_hideous_sh_bug=$base_compile
1848 if test "$pic_mode" != no; then
1849 command="$base_compile $qsrcfile $pic_flag"
1851 # Don't build PIC code
1852 command="$base_compile $qsrcfile"
1855 func_mkdir_p "$xdir$objdir"
1857 if test -z "$output_obj"; then
1858 # Place PIC objects in $objdir
1859 command="$command -o $lobj"
1862 func_show_eval_locale "$command" \
1863 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
1865 if test "$need_locks" = warn &&
1866 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1868 *** ERROR, $lockfile contains:
1869 `cat $lockfile 2>/dev/null`
1871 but it should contain:
1874 This indicates that another process is trying to use the same
1875 temporary object file, and libtool could not work around it because
1876 your compiler does not support \`-c' and \`-o' together. If you
1877 repeat this compilation, it may succeed, by chance, but you had better
1878 avoid parallel builds (make -j) in this platform, or get a better
1881 $opt_dry_run || $RM $removelist
1885 # Just move the object if needed, then go on to compile the next one
1886 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1887 func_show_eval '$MV "$output_obj" "$lobj"' \
1888 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
1891 # Allow error messages only from the first compilation.
1892 if test "$suppress_opt" = yes; then
1893 suppress_output=' >/dev/null 2>&1'
1897 # Only build a position-dependent object if we build old libraries.
1898 if test "$build_old_libs" = yes; then
1899 if test "$pic_mode" != yes; then
1900 # Don't build PIC code
1901 command="$base_compile $qsrcfile$pie_flag"
1903 command="$base_compile $qsrcfile $pic_flag"
1905 if test "$compiler_c_o" = yes; then
1906 command="$command -o $obj"
1909 # Suppress compiler output if we already did a PIC compilation.
1910 command="$command$suppress_output"
1911 func_show_eval_locale "$command" \
1912 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
1914 if test "$need_locks" = warn &&
1915 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1917 *** ERROR, $lockfile contains:
1918 `cat $lockfile 2>/dev/null`
1920 but it should contain:
1923 This indicates that another process is trying to use the same
1924 temporary object file, and libtool could not work around it because
1925 your compiler does not support \`-c' and \`-o' together. If you
1926 repeat this compilation, it may succeed, by chance, but you had better
1927 avoid parallel builds (make -j) in this platform, or get a better
1930 $opt_dry_run || $RM $removelist
1934 # Just move the object if needed
1935 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1936 func_show_eval '$MV "$output_obj" "$obj"' \
1937 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
1942 func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
1944 # Unlock the critical section if it was locked
1945 if test "$need_locks" != no; then
1946 removelist=$lockfile
1955 test "$mode" = compile && func_mode_compile ${1+"$@"}
1960 # We need to display help for each of the modes.
1963 # Generic help is extracted from the usage comments
1964 # at the start of this file.
1970 "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
1972 Remove files from the build directory.
1974 RM is the name of the program to use to delete files associated with each FILE
1975 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
1978 If FILE is a libtool library, object or program, all the files associated
1979 with it are deleted. Otherwise, only FILE itself is deleted using RM."
1984 "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
1986 Compile a source file into a libtool library object.
1988 This mode accepts the following additional options:
1990 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
1991 -no-suppress do not suppress compiler output for multiple passes
1992 -prefer-pic try to building PIC objects only
1993 -prefer-non-pic try to building non-PIC objects only
1994 -shared do not build a \`.o' file suitable for static linking
1995 -static only build a \`.o' file suitable for static linking
1997 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
1998 from the given SOURCEFILE.
2000 The output file name is determined by removing the directory component from
2001 SOURCEFILE, then substituting the C source code suffix \`.c' with the
2002 library object suffix, \`.lo'."
2007 "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
2009 Automatically set library path, then run a program.
2011 This mode accepts the following additional options:
2013 -dlopen FILE add the directory containing FILE to the library path
2015 This mode sets the library path environment variable according to \`-dlopen'
2018 If any of the ARGS are libtool executable wrappers, then they are translated
2019 into their corresponding uninstalled binary, and any of their required library
2020 directories are added to the library path.
2022 Then, COMMAND is executed, with ARGS as arguments."
2027 "Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
2029 Complete the installation of libtool libraries.
2031 Each LIBDIR is a directory that contains libtool libraries.
2033 The commands that this mode executes may require superuser privileges. Use
2034 the \`--dry-run' option if you just want to see what would be executed."
2039 "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
2041 Install executables or libraries.
2043 INSTALL-COMMAND is the installation command. The first component should be
2044 either the \`install' or \`cp' program.
2046 The following components of INSTALL-COMMAND are treated specially:
2048 -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation
2050 The rest of the components are interpreted as arguments to that command (only
2051 BSD-compatible install options are recognized)."
2056 "Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
2058 Link object files or libraries together to form another library, or to
2059 create an executable program.
2061 LINK-COMMAND is a command using the C compiler that you would use to create
2062 a program from several object files.
2064 The following components of LINK-COMMAND are treated specially:
2066 -all-static do not do any dynamic linking at all
2067 -avoid-version do not add a version suffix if possible
2068 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
2069 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
2070 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
2071 -export-symbols SYMFILE
2072 try to export only the symbols listed in SYMFILE
2073 -export-symbols-regex REGEX
2074 try to export only the symbols matching REGEX
2075 -LLIBDIR search LIBDIR for required installed libraries
2076 -lNAME OUTPUT-FILE requires the installed library libNAME
2077 -module build a library that can dlopened
2078 -no-fast-install disable the fast-install mode
2079 -no-install link a not-installable executable
2080 -no-undefined declare that a library does not refer to external symbols
2081 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
2082 -objectlist FILE Use a list of object files found in FILE to specify objects
2083 -precious-files-regex REGEX
2084 don't remove output files matching REGEX
2085 -release RELEASE specify package release information
2086 -rpath LIBDIR the created library will eventually be installed in LIBDIR
2087 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
2088 -shared only do dynamic linking of libtool libraries
2089 -shrext SUFFIX override the standard shared library file extension
2090 -static do not do any dynamic linking of uninstalled libtool libraries
2091 -static-libtool-libs
2092 do not do any dynamic linking of libtool libraries
2093 -version-info CURRENT[:REVISION[:AGE]]
2094 specify library version info [each variable defaults to 0]
2095 -weak LIBNAME declare that the target provides the LIBNAME interface
2097 All other options (arguments beginning with \`-') are ignored.
2099 Every other argument is treated as a filename. Files ending in \`.la' are
2100 treated as uninstalled libtool libraries, other files are standard or library
2103 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
2104 only library objects (\`.lo' files) may be specified, and \`-rpath' is
2105 required, except when creating a convenience library.
2107 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
2108 using \`ar' and \`ranlib', or on Windows using \`lib'.
2110 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
2111 is created, otherwise an executable program is created."
2116 "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
2118 Remove libraries from an installation directory.
2120 RM is the name of the program to use to delete files associated with each FILE
2121 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2124 If FILE is a libtool library, all the files associated with it are deleted.
2125 Otherwise, only FILE itself is deleted using RM."
2129 func_fatal_help "invalid operation mode \`$mode'"
2134 $ECHO "Try \`$progname --help' for more information about other modes."
2139 # Now that we've collected a possible --mode arg, show help if necessary
2140 $opt_help && func_mode_help
2143 # func_mode_execute arg...
2144 func_mode_execute ()
2147 # The first argument is the command name.
2150 func_fatal_help "you must specify a COMMAND"
2152 # Handle -dlopen flags immediately.
2153 for file in $execute_dlfiles; do
2155 || func_fatal_help "\`$file' is not a file"
2160 # Check to see that this really is a libtool archive.
2161 func_lalib_unsafe_p "$file" \
2162 || func_fatal_help "\`$lib' is not a valid libtool archive"
2164 # Read the libtool library.
2169 # Skip this library if it cannot be dlopened.
2170 if test -z "$dlname"; then
2171 # Warn if it was a shared library.
2172 test -n "$library_names" && \
2173 func_warning "\`$file' was not linked with \`-export-dynamic'"
2177 func_dirname "$file" "" "."
2178 dir="$func_dirname_result"
2180 if test -f "$dir/$objdir/$dlname"; then
2183 if test ! -f "$dir/$dlname"; then
2184 func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
2190 # Just add the directory containing the .lo file.
2191 func_dirname "$file" "" "."
2192 dir="$func_dirname_result"
2196 func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
2201 # Get the absolute pathname.
2202 absdir=`cd "$dir" && pwd`
2203 test -n "$absdir" && dir="$absdir"
2205 # Now add the directory to shlibpath_var.
2206 if eval "test -z \"\$$shlibpath_var\""; then
2207 eval "$shlibpath_var=\"\$dir\""
2209 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
2213 # This variable tells wrapper scripts just to set shlibpath_var
2214 # rather than running their programs.
2215 libtool_execute_magic="$magic"
2217 # Check if any of the arguments is a wrapper script.
2224 # Do a test to see if this is really a libtool program.
2225 if func_ltwrapper_script_p "$file"; then
2227 # Transform arg to wrapped name.
2228 file="$progdir/$program"
2229 elif func_ltwrapper_executable_p "$file"; then
2230 func_ltwrapper_scriptname "$file"
2231 func_source "$func_ltwrapper_scriptname_result"
2232 # Transform arg to wrapped name.
2233 file="$progdir/$program"
2237 # Quote arguments (to preserve shell metacharacters).
2238 func_quote_for_eval "$file"
2239 args="$args $func_quote_for_eval_result"
2242 if test "X$opt_dry_run" = Xfalse; then
2243 if test -n "$shlibpath_var"; then
2244 # Export the shlibpath_var.
2245 eval "export $shlibpath_var"
2248 # Restore saved environment variables
2249 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
2251 eval "if test \"\${save_$lt_var+set}\" = set; then
2252 $lt_var=\$save_$lt_var; export $lt_var
2258 # Now prepare to actually exec the command.
2259 exec_cmd="\$cmd$args"
2261 # Display what would be done.
2262 if test -n "$shlibpath_var"; then
2263 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
2264 $ECHO "export $shlibpath_var"
2271 test "$mode" = execute && func_mode_execute ${1+"$@"}
2274 # func_mode_finish arg...
2281 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
2284 libdirs="$libdirs $dir"
2287 for libdir in $libdirs; do
2288 if test -n "$finish_cmds"; then
2289 # Do each command in the finish commands.
2290 func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
2293 if test -n "$finish_eval"; then
2294 # Do the single finish_eval.
2295 eval cmds=\"$finish_eval\"
2296 $opt_dry_run || eval "$cmds" || admincmds="$admincmds
2302 # Exit here if they wanted silent mode.
2303 $opt_silent && exit $EXIT_SUCCESS
2305 $ECHO "X----------------------------------------------------------------------" | $Xsed
2306 $ECHO "Libraries have been installed in:"
2307 for libdir in $libdirs; do
2311 $ECHO "If you ever happen to want to link against installed libraries"
2312 $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
2313 $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
2314 $ECHO "flag during linking and do at least one of the following:"
2315 if test -n "$shlibpath_var"; then
2316 $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable"
2317 $ECHO " during execution"
2319 if test -n "$runpath_var"; then
2320 $ECHO " - add LIBDIR to the \`$runpath_var' environment variable"
2321 $ECHO " during linking"
2323 if test -n "$hardcode_libdir_flag_spec"; then
2325 eval flag=\"$hardcode_libdir_flag_spec\"
2327 $ECHO " - use the \`$flag' linker flag"
2329 if test -n "$admincmds"; then
2330 $ECHO " - have your system administrator run these commands:$admincmds"
2332 if test -f /etc/ld.so.conf; then
2333 $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
2337 $ECHO "See any operating system documentation about shared libraries for"
2339 solaris2.[6789]|solaris2.1[0-9])
2340 $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
2344 $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
2347 $ECHO "X----------------------------------------------------------------------" | $Xsed
2351 test "$mode" = finish && func_mode_finish ${1+"$@"}
2354 # func_mode_install arg...
2355 func_mode_install ()
2358 # There may be an optional sh(1) argument at the beginning of
2359 # install_prog (especially on Windows NT).
2360 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
2361 # Allow the use of GNU shtool's install command.
2362 $ECHO "X$nonopt" | $GREP shtool >/dev/null; then
2363 # Aesthetically quote it.
2364 func_quote_for_eval "$nonopt"
2365 install_prog="$func_quote_for_eval_result "
2373 # The real first argument should be the name of the installation program.
2374 # Aesthetically quote it.
2375 func_quote_for_eval "$arg"
2376 install_prog="$install_prog$func_quote_for_eval_result"
2378 # We need to accept at least all the BSD install flags.
2388 if test -n "$dest"; then
2389 files="$files $dest"
2397 case " $install_prog " in
2412 # If the previous option needed an argument, then skip it.
2413 if test -n "$prev"; then
2422 # Aesthetically quote the argument.
2423 func_quote_for_eval "$arg"
2424 install_prog="$install_prog $func_quote_for_eval_result"
2427 test -z "$install_prog" && \
2428 func_fatal_help "you must specify an install program"
2430 test -n "$prev" && \
2431 func_fatal_help "the \`$prev' option requires an argument"
2433 if test -z "$files"; then
2434 if test -z "$dest"; then
2435 func_fatal_help "no file or destination specified"
2437 func_fatal_help "you must specify a destination"
2441 # Strip any trailing slash from the destination.
2442 func_stripname '' '/' "$dest"
2443 dest=$func_stripname_result
2445 # Check to see that the destination is a directory.
2446 test -d "$dest" && isdir=yes
2447 if test "$isdir" = yes; then
2451 func_dirname_and_basename "$dest" "" "."
2452 destdir="$func_dirname_result"
2453 destname="$func_basename_result"
2455 # Not a directory, so check to see that there is only one file specified.
2456 set dummy $files; shift
2457 test "$#" -gt 1 && \
2458 func_fatal_help "\`$dest' is not a directory"
2461 [\\/]* | [A-Za-z]:[\\/]*) ;;
2463 for file in $files; do
2467 func_fatal_help "\`$destdir' must be an absolute directory name"
2474 # This variable tells wrapper scripts just to set variables rather
2475 # than running their programs.
2476 libtool_install_magic="$magic"
2481 for file in $files; do
2483 # Do each installation.
2486 # Do the static libraries later.
2487 staticlibs="$staticlibs $file"
2491 # Check to see that this really is a libtool archive.
2492 func_lalib_unsafe_p "$file" \
2493 || func_fatal_help "\`$file' is not a valid libtool archive"
2500 # Add the libdir to current_libdirs if it is the destination.
2501 if test "X$destdir" = "X$libdir"; then
2502 case "$current_libdirs " in
2504 *) current_libdirs="$current_libdirs $libdir" ;;
2507 # Note the libdir as a future libdir.
2508 case "$future_libdirs " in
2510 *) future_libdirs="$future_libdirs $libdir" ;;
2514 func_dirname "$file" "/" ""
2515 dir="$func_dirname_result"
2518 if test -n "$relink_command"; then
2519 # Determine the prefix the user has applied to our future dir.
2520 inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
2522 # Don't allow the user to place us outside of our expected
2523 # location b/c this prevents finding dependent libraries that
2524 # are installed to the same prefix.
2525 # At present, this check doesn't affect windows .dll's that
2526 # are installed into $libdir/../bin (currently, that works fine)
2527 # but it's something to keep an eye on.
2528 test "$inst_prefix_dir" = "$destdir" && \
2529 func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
2531 if test -n "$inst_prefix_dir"; then
2532 # Stick the inst_prefix_dir data into the link command.
2533 relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
2535 relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
2538 func_warning "relinking \`$file'"
2539 func_show_eval "$relink_command" \
2540 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
2543 # See the names of the shared library.
2544 set dummy $library_names; shift
2545 if test -n "$1"; then
2550 test -n "$relink_command" && srcname="$realname"T
2552 # Install the shared library and build the symlinks.
2553 func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
2557 cygwin* | mingw* | pw32* | cegcc*)
2565 if test -n "$tstripme" && test -n "$striplib"; then
2566 func_show_eval "$striplib $destdir/$realname" 'exit $?'
2569 if test "$#" -gt 0; then
2570 # Delete the old symlinks, and create new ones.
2571 # Try `ln -sf' first, because the `ln' binary might depend on
2572 # the symlink we replace! Solaris /bin/ln does not understand -f,
2573 # so we also need to try rm && ln -s.
2576 test "$linkname" != "$realname" \
2577 && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
2581 # Do each command in the postinstall commands.
2582 lib="$destdir/$realname"
2583 func_execute_cmds "$postinstall_cmds" 'exit $?'
2586 # Install the pseudo-library for information purposes.
2587 func_basename "$file"
2588 name="$func_basename_result"
2589 instname="$dir/$name"i
2590 func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
2592 # Maybe install the static library, too.
2593 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
2597 # Install (i.e. copy) a libtool object.
2599 # Figure out destination file name, if it wasn't already specified.
2600 if test -n "$destname"; then
2601 destfile="$destdir/$destname"
2603 func_basename "$file"
2604 destfile="$func_basename_result"
2605 destfile="$destdir/$destfile"
2608 # Deduce the name of the destination old-style object file.
2611 func_lo2o "$destfile"
2612 staticdest=$func_lo2o_result
2615 staticdest="$destfile"
2619 func_fatal_help "cannot copy a libtool object to \`$destfile'"
2623 # Install the libtool object if requested.
2624 test -n "$destfile" && \
2625 func_show_eval "$install_prog $file $destfile" 'exit $?'
2627 # Install the old object if enabled.
2628 if test "$build_old_libs" = yes; then
2629 # Deduce the name of the old-style object file.
2631 staticobj=$func_lo2o_result
2632 func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
2638 # Figure out destination file name, if it wasn't already specified.
2639 if test -n "$destname"; then
2640 destfile="$destdir/$destname"
2642 func_basename "$file"
2643 destfile="$func_basename_result"
2644 destfile="$destdir/$destfile"
2647 # If the file is missing, and there is a .exe on the end, strip it
2648 # because it is most likely a libtool script we actually want to
2653 if test ! -f "$file"; then
2654 func_stripname '' '.exe' "$file"
2655 file=$func_stripname_result
2661 # Do a test to see if this is really a libtool program.
2664 if func_ltwrapper_executable_p "$file"; then
2665 func_ltwrapper_scriptname "$file"
2666 wrapper=$func_ltwrapper_scriptname_result
2668 func_stripname '' '.exe' "$file"
2669 wrapper=$func_stripname_result
2676 if func_ltwrapper_script_p "$wrapper"; then
2680 func_source "$wrapper"
2682 # Check the variables that should have been set.
2683 test -z "$generated_by_libtool_version" && \
2684 func_fatal_error "invalid libtool wrapper script \`$wrapper'"
2687 for lib in $notinst_deplibs; do
2688 # Check to see that each library is installed.
2690 if test -f "$lib"; then
2693 libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
2694 if test -n "$libdir" && test ! -f "$libfile"; then
2695 func_warning "\`$lib' has not been installed in \`$libdir'"
2701 func_source "$wrapper"
2704 if test "$fast_install" = no && test -n "$relink_command"; then
2706 if test "$finalize" = yes; then
2707 tmpdir=`func_mktempdir`
2708 func_basename "$file$stripped_ext"
2709 file="$func_basename_result"
2710 outputname="$tmpdir/$file"
2711 # Replace the output file specification.
2712 relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
2715 func_quote_for_expand "$relink_command"
2716 eval "func_echo $func_quote_for_expand_result"
2718 if eval "$relink_command"; then :
2720 func_error "error: relink \`$file' with the above command before installing it"
2721 $opt_dry_run || ${RM}r "$tmpdir"
2726 func_warning "cannot relink \`$file'"
2730 # Install the binary that we compiled earlier.
2731 file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
2735 # remove .exe since cygwin /usr/bin/install will append another
2737 case $install_prog,$host in
2738 */usr/bin/install*,*cygwin*)
2739 case $file:$destfile in
2744 destfile=$destfile.exe
2747 func_stripname '' '.exe' "$destfile"
2748 destfile=$func_stripname_result
2753 func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
2754 $opt_dry_run || if test -n "$outputname"; then
2761 for file in $staticlibs; do
2762 func_basename "$file"
2763 name="$func_basename_result"
2765 # Set up the ranlib parameters.
2766 oldlib="$destdir/$name"
2768 func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
2770 if test -n "$stripme" && test -n "$old_striplib"; then
2771 func_show_eval "$old_striplib $oldlib" 'exit $?'
2774 # Do each command in the postinstall commands.
2775 func_execute_cmds "$old_postinstall_cmds" 'exit $?'
2778 test -n "$future_libdirs" && \
2779 func_warning "remember to run \`$progname --finish$future_libdirs'"
2781 if test -n "$current_libdirs"; then
2782 # Maybe just do a dry run.
2783 $opt_dry_run && current_libdirs=" -n$current_libdirs"
2784 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
2790 test "$mode" = install && func_mode_install ${1+"$@"}
2793 # func_generate_dlsyms outputname originator pic_p
2794 # Extract symbols from dlprefiles and create ${outputname}S.o with
2795 # a dlpreopen symbol table.
2796 func_generate_dlsyms ()
2802 my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
2805 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2806 if test -n "$NM" && test -n "$global_symbol_pipe"; then
2807 my_dlsyms="${my_outputname}S.c"
2809 func_error "not configured to extract global symbols from dlpreopened files"
2813 if test -n "$my_dlsyms"; then
2817 # Discover the nlist of each of the dlfiles.
2818 nlist="$output_objdir/${my_outputname}.nm"
2820 func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
2822 # Parse the name list into a source file.
2823 func_verbose "creating $output_objdir/$my_dlsyms"
2825 $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
2826 /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
2827 /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
2833 /* External symbol declarations for the compiler. */\
2836 if test "$dlself" = yes; then
2837 func_verbose "generating symbol list for \`$output'"
2839 $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
2841 # Add our own program objects to the symbol list.
2842 progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2843 for progfile in $progfiles; do
2844 func_verbose "extracting global C symbols from \`$progfile'"
2845 $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
2848 if test -n "$exclude_expsyms"; then
2850 eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
2851 eval '$MV "$nlist"T "$nlist"'
2855 if test -n "$export_symbols_regex"; then
2857 eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
2858 eval '$MV "$nlist"T "$nlist"'
2862 # Prepare the list of exported symbols
2863 if test -z "$export_symbols"; then
2864 export_symbols="$output_objdir/$outputname.exp"
2867 eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
2869 *cygwin* | *mingw* | *cegcc* )
2870 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
2871 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
2877 eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
2878 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
2879 eval '$MV "$nlist"T "$nlist"'
2881 *cygwin | *mingw* | *cegcc* )
2882 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
2883 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
2890 for dlprefile in $dlprefiles; do
2891 func_verbose "extracting global C symbols from \`$dlprefile'"
2892 func_basename "$dlprefile"
2893 name="$func_basename_result"
2895 eval '$ECHO ": $name " >> "$nlist"'
2896 eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
2901 # Make sure we have at least an empty file.
2902 test -f "$nlist" || : > "$nlist"
2904 if test -n "$exclude_expsyms"; then
2905 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
2906 $MV "$nlist"T "$nlist"
2909 # Try sorting and uniquifying the output.
2910 if $GREP -v "^: " < "$nlist" |
2911 if sort -k 3 </dev/null >/dev/null 2>&1; then
2916 uniq > "$nlist"S; then
2919 $GREP -v "^: " < "$nlist" > "$nlist"S
2922 if test -f "$nlist"S; then
2923 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
2925 $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
2928 $ECHO >> "$output_objdir/$my_dlsyms" "\
2930 /* The mapping between symbol names and symbols. */
2937 *cygwin* | *mingw* | *cegcc* )
2938 $ECHO >> "$output_objdir/$my_dlsyms" "\
2939 /* DATA imports from DLLs on WIN32 con't be const, because
2940 runtime relocations are performed -- see ld's documentation
2941 on pseudo-relocs. */"
2944 echo >> "$output_objdir/$my_dlsyms" "\
2945 /* This system does not cope well with relocations in const data */"
2948 lt_dlsym_const=const ;;
2951 $ECHO >> "$output_objdir/$my_dlsyms" "\
2952 extern $lt_dlsym_const lt_dlsymlist
2953 lt_${my_prefix}_LTX_preloaded_symbols[];
2954 $lt_dlsym_const lt_dlsymlist
2955 lt_${my_prefix}_LTX_preloaded_symbols[] =
2957 { \"$my_originator\", (void *) 0 },"
2959 case $need_lib_prefix in
2961 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
2964 eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
2967 $ECHO >> "$output_objdir/$my_dlsyms" "\
2971 /* This works around a problem in FreeBSD linker */
2972 #ifdef FREEBSD_WORKAROUND
2973 static const void *lt_preloaded_setup() {
2974 return lt_${my_prefix}_LTX_preloaded_symbols;
2984 pic_flag_for_symtable=
2985 case "$compile_command " in
2989 # compiling the symbol table file with pic_flag works around
2990 # a FreeBSD bug that causes programs to crash when -lm is
2991 # linked before any other PIC object. But we must not use
2992 # pic_flag when linking with -static. The problem exists in
2993 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
2994 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
2995 pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
2997 pic_flag_for_symtable=" $pic_flag" ;;
2999 if test "X$my_pic_p" != Xno; then
3000 pic_flag_for_symtable=" $pic_flag"
3007 for arg in $LTCFLAGS; do
3009 -pie | -fpie | -fPIE) ;;
3010 *) symtab_cflags="$symtab_cflags $arg" ;;
3014 # Now compile the dynamic symbol file.
3015 func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
3017 # Clean up the generated files.
3018 func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
3020 # Transform the symbol file into the correct name.
3021 symfileobj="$output_objdir/${my_outputname}S.$objext"
3023 *cygwin* | *mingw* | *cegcc* )
3024 if test -f "$output_objdir/$my_outputname.def"; then
3025 compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
3026 finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
3028 compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
3029 finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
3033 compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
3034 finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
3039 func_fatal_error "unknown suffix for \`$my_dlsyms'"
3043 # We keep going just in case the user didn't refer to
3044 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3045 # really was required.
3047 # Nullify the symbol file.
3048 compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3049 finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3053 # func_win32_libid arg
3054 # return the library type of file 'arg'
3056 # Need a lot of goo to handle *both* DLLs and import libs
3057 # Has to be a shell function in order to 'eat' the argument
3058 # that is supplied when $file_magic_command is called.
3062 win32_libid_type="unknown"
3063 win32_fileres=`file -L $1 2>/dev/null`
3064 case $win32_fileres in
3065 *ar\ archive\ import\ library*) # definitely import
3066 win32_libid_type="x86 archive import"
3068 *ar\ archive*) # could be an import, or static
3069 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
3070 $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
3071 win32_nmres=`eval $NM -f posix -A $1 |
3080 case $win32_nmres in
3081 import*) win32_libid_type="x86 archive import";;
3082 *) win32_libid_type="x86 archive static";;
3087 win32_libid_type="x86 DLL"
3089 *executable*) # but shell scripts are "executable" too...
3090 case $win32_fileres in
3091 *MS\ Windows\ PE\ Intel*)
3092 win32_libid_type="x86 DLL"
3097 $ECHO "$win32_libid_type"
3102 # func_extract_an_archive dir oldlib
3103 func_extract_an_archive ()
3106 f_ex_an_ar_dir="$1"; shift
3107 f_ex_an_ar_oldlib="$1"
3108 func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
3109 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
3112 func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
3117 # func_extract_archives gentop oldlib ...
3118 func_extract_archives ()
3121 my_gentop="$1"; shift
3122 my_oldlibs=${1+"$@"}
3128 for my_xlib in $my_oldlibs; do
3129 # Extract the objects.
3131 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
3132 *) my_xabs=`pwd`"/$my_xlib" ;;
3134 func_basename "$my_xlib"
3135 my_xlib="$func_basename_result"
3138 case " $extracted_archives " in
3140 func_arith $extracted_serial + 1
3141 extracted_serial=$func_arith_result
3142 my_xlib_u=lt$extracted_serial-$my_xlib ;;
3146 extracted_archives="$extracted_archives $my_xlib_u"
3147 my_xdir="$my_gentop/$my_xlib_u"
3149 func_mkdir_p "$my_xdir"
3153 func_verbose "Extracting $my_xabs"
3154 # Do not bother doing anything if just a dry run
3156 darwin_orig_dir=`pwd`
3157 cd $my_xdir || exit $?
3158 darwin_archive=$my_xabs
3160 darwin_base_archive=`basename "$darwin_archive"`
3161 darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
3162 if test -n "$darwin_arches"; then
3163 darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
3165 func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
3166 for darwin_arch in $darwin_arches ; do
3167 func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
3168 $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
3169 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
3170 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
3172 $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
3173 done # $darwin_arches
3174 ## Okay now we've a bunch of thin objects, gotta fatten them up :)
3175 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
3178 for darwin_file in $darwin_filelist; do
3179 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
3180 $LIPO -create -output "$darwin_file" $darwin_files
3181 done # $darwin_filelist
3183 cd "$darwin_orig_dir"
3186 func_extract_an_archive "$my_xdir" "$my_xabs"
3191 func_extract_an_archive "$my_xdir" "$my_xabs"
3194 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3197 func_extract_archives_result="$my_oldobjs"
3202 # func_emit_wrapper_part1 [arg=no]
3204 # Emit the first part of a libtool wrapper script on stdout.
3205 # For more information, see the description associated with
3206 # func_emit_wrapper(), below.
3207 func_emit_wrapper_part1 ()
3209 func_emit_wrapper_part1_arg1=no
3210 if test -n "$1" ; then
3211 func_emit_wrapper_part1_arg1=$1
3217 # $output - temporary wrapper script for $objdir/$outputname
3218 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
3220 # The $output program cannot be directly executed until all the libtool
3221 # libraries that it depends on are installed.
3223 # This wrapper script should never be moved out of the build directory.
3224 # If it is, it will not operate correctly.
3226 # Sed substitution that helps us do robust quoting. It backslashifies
3227 # metacharacters that are still active within double-quoted strings.
3228 Xsed='${SED} -e 1s/^X//'
3229 sed_quote_subst='$sed_quote_subst'
3231 # Be Bourne compatible
3232 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
3235 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
3236 # is contrary to our usage. Disable this feature.
3237 alias -g '\${1+\"\$@\"}'='\"\$@\"'
3238 setopt NO_GLOB_SUBST
3240 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
3242 BIN_SH=xpg4; export BIN_SH # for Tru64
3243 DUALCASE=1; export DUALCASE # for MKS sh
3245 # The HP-UX ksh and POSIX shell print the target directory to stdout
3247 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
3249 relink_command=\"$relink_command\"
3251 # This environment variable determines our operation mode.
3252 if test \"\$libtool_install_magic\" = \"$magic\"; then
3253 # install mode needs the following variables:
3254 generated_by_libtool_version='$macro_version'
3255 notinst_deplibs='$notinst_deplibs'
3257 # When we are sourced in execute mode, \$file and \$ECHO are already set.
3258 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3261 # Make sure echo works.
3262 if test \"X\$1\" = X--no-reexec; then
3263 # Discard the --no-reexec flag, and continue.
3265 elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
3266 # Yippee, \$ECHO works!
3269 # Restart under the correct shell, and then maybe \$ECHO will work.
3270 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
3276 # Find the directory that this script lives in.
3277 thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3278 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3280 # Follow symbolic links until we get to the real thisdir.
3281 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
3282 while test -n \"\$file\"; do
3283 destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3285 # If there was a directory component, then change thisdir.
3286 if test \"x\$destdir\" != \"x\$file\"; then
3287 case \"\$destdir\" in
3288 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
3289 *) thisdir=\"\$thisdir/\$destdir\" ;;
3293 file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3294 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
3298 # end: func_emit_wrapper_part1
3300 # func_emit_wrapper_part2 [arg=no]
3302 # Emit the second part of a libtool wrapper script on stdout.
3303 # For more information, see the description associated with
3304 # func_emit_wrapper(), below.
3305 func_emit_wrapper_part2 ()
3307 func_emit_wrapper_part2_arg1=no
3308 if test -n "$1" ; then
3309 func_emit_wrapper_part2_arg1=$1
3314 # Usually 'no', except on cygwin/mingw when embedded into
3316 WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
3317 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
3318 # special case for '.'
3319 if test \"\$thisdir\" = \".\"; then
3322 # remove .libs from thisdir
3323 case \"\$thisdir\" in
3324 *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
3325 $objdir ) thisdir=. ;;
3329 # Try to get the absolute directory name.
3330 absdir=\`cd \"\$thisdir\" && pwd\`
3331 test -n \"\$absdir\" && thisdir=\"\$absdir\"
3334 if test "$fast_install" = yes; then
3336 program=lt-'$outputname'$exeext
3337 progdir=\"\$thisdir/$objdir\"
3339 if test ! -f \"\$progdir/\$program\" ||
3340 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
3341 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3343 file=\"\$\$-\$program\"
3345 if test ! -d \"\$progdir\"; then
3346 $MKDIR \"\$progdir\"
3348 $RM \"\$progdir/\$file\"
3353 # relink executable if necessary
3354 if test -n \"\$relink_command\"; then
3355 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
3357 $ECHO \"\$relink_command_output\" >&2
3358 $RM \"\$progdir/\$file\"
3363 $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
3364 { $RM \"\$progdir/\$program\";
3365 $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
3366 $RM \"\$progdir/\$file\"
3370 program='$outputname'
3371 progdir=\"\$thisdir/$objdir\"
3377 if test -f \"\$progdir/\$program\"; then"
3379 # Export our shlibpath_var if we have one.
3380 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3382 # Add our own library path to $shlibpath_var
3383 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
3385 # Some systems cannot cope with colon-terminated $shlibpath_var
3386 # The second colon is a workaround for a bug in BeOS R4 sed
3387 $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
3389 export $shlibpath_var
3393 # fixup the dll searchpath if we need to.
3394 if test -n "$dllsearchpath"; then
3396 # Add the dll search path components to the executable PATH
3397 PATH=$dllsearchpath:\$PATH
3402 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3403 # Run the actual program with our arguments.
3406 # Backslashes separate directories on plain windows
3407 *-*-mingw | *-*-os2* | *-cegcc*)
3409 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
3415 exec \"\$progdir/\$program\" \${1+\"\$@\"}
3420 \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
3424 # The program doesn't exist.
3425 \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
3426 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
3427 $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
3433 # end: func_emit_wrapper_part2
3436 # func_emit_wrapper [arg=no]
3438 # Emit a libtool wrapper script on stdout.
3439 # Don't directly open a file because we may want to
3440 # incorporate the script contents within a cygwin/mingw
3441 # wrapper executable. Must ONLY be called from within
3442 # func_mode_link because it depends on a number of variables
3445 # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
3446 # variable will take. If 'yes', then the emitted script
3447 # will assume that the directory in which it is stored is
3448 # the $objdir directory. This is a cygwin/mingw-specific
3450 func_emit_wrapper ()
3452 func_emit_wrapper_arg1=no
3453 if test -n "$1" ; then
3454 func_emit_wrapper_arg1=$1
3457 # split this up so that func_emit_cwrapperexe_src
3458 # can call each part independently.
3459 func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
3460 func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
3464 # func_to_host_path arg
3466 # Convert paths to host format when used with build tools.
3467 # Intended for use with "native" mingw (where libtool itself
3468 # is running under the msys shell), or in the following cross-
3469 # build environments:
3471 # mingw (msys) mingw [e.g. native]
3474 # where wine is equipped with the `winepath' executable.
3475 # In the native mingw case, the (msys) shell automatically
3476 # converts paths for any non-msys applications it launches,
3477 # but that facility isn't available from inside the cwrapper.
3478 # Similar accommodations are necessary for $host mingw and
3479 # $build cygwin. Calling this function does no harm for other
3480 # $host/$build combinations not listed above.
3482 # ARG is the path (on $build) that should be converted to
3483 # the proper representation for $host. The result is stored
3484 # in $func_to_host_path_result.
3485 func_to_host_path ()
3487 func_to_host_path_result="$1"
3488 if test -n "$1" ; then
3491 lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
3493 *mingw* ) # actually, msys
3494 # awkward: cmd appends spaces to result
3495 lt_sed_strip_trailing_spaces="s/[ ]*\$//"
3496 func_to_host_path_tmp1=`( cmd //c echo "$1" |\
3497 $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
3498 func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
3499 $SED -e "$lt_sed_naive_backslashify"`
3502 func_to_host_path_tmp1=`cygpath -w "$1"`
3503 func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
3504 $SED -e "$lt_sed_naive_backslashify"`
3507 # Unfortunately, winepath does not exit with a non-zero
3508 # error code, so we are forced to check the contents of
3509 # stdout. On the other hand, if the command is not
3510 # found, the shell will set an exit code of 127 and print
3511 # *an error message* to stdout. So we must check for both
3512 # error code of zero AND non-empty stdout, which explains
3513 # the odd construction:
3514 func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
3515 if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
3516 func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
3517 $SED -e "$lt_sed_naive_backslashify"`
3519 # Allow warning below.
3520 func_to_host_path_result=""
3524 if test -z "$func_to_host_path_result" ; then
3525 func_error "Could not determine host path corresponding to"
3527 func_error "Continuing, but uninstalled executables may not work."
3529 func_to_host_path_result="$1"
3535 # end: func_to_host_path
3537 # func_to_host_pathlist arg
3539 # Convert pathlists to host format when used with build tools.
3540 # See func_to_host_path(), above. This function supports the
3541 # following $build/$host combinations (but does no harm for
3542 # combinations not listed here):
3544 # mingw (msys) mingw [e.g. native]
3548 # Path separators are also converted from $build format to
3549 # $host format. If ARG begins or ends with a path separator
3550 # character, it is preserved (but converted to $host format)
3553 # ARG is a pathlist (on $build) that should be converted to
3554 # the proper representation on $host. The result is stored
3555 # in $func_to_host_pathlist_result.
3556 func_to_host_pathlist ()
3558 func_to_host_pathlist_result="$1"
3559 if test -n "$1" ; then
3562 lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
3563 # Remove leading and trailing path separator characters from
3564 # ARG. msys behavior is inconsistent here, cygpath turns them
3565 # into '.;' and ';.', and winepath ignores them completely.
3566 func_to_host_pathlist_tmp2="$1"
3567 # Once set for this call, this variable should not be
3568 # reassigned. It is used in tha fallback case.
3569 func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
3570 $SED -e 's|^:*||' -e 's|:*$||'`
3572 *mingw* ) # Actually, msys.
3573 # Awkward: cmd appends spaces to result.
3574 lt_sed_strip_trailing_spaces="s/[ ]*\$//"
3575 func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
3576 $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
3577 func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
3578 $SED -e "$lt_sed_naive_backslashify"`
3581 func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
3582 func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
3583 $SED -e "$lt_sed_naive_backslashify"`
3586 # unfortunately, winepath doesn't convert pathlists
3587 func_to_host_pathlist_result=""
3588 func_to_host_pathlist_oldIFS=$IFS
3590 for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
3591 IFS=$func_to_host_pathlist_oldIFS
3592 if test -n "$func_to_host_pathlist_f" ; then
3593 func_to_host_path "$func_to_host_pathlist_f"
3594 if test -n "$func_to_host_path_result" ; then
3595 if test -z "$func_to_host_pathlist_result" ; then
3596 func_to_host_pathlist_result="$func_to_host_path_result"
3598 func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
3604 IFS=$func_to_host_pathlist_oldIFS
3607 if test -z "$func_to_host_pathlist_result" ; then
3608 func_error "Could not determine the host path(s) corresponding to"
3610 func_error "Continuing, but uninstalled executables may not work."
3611 # Fallback. This may break if $1 contains DOS-style drive
3612 # specifications. The fix is not to complicate the expression
3613 # below, but for the user to provide a working wine installation
3614 # with winepath so that path translation in the cross-to-mingw
3615 # case works properly.
3616 lt_replace_pathsep_nix_to_dos="s|:|;|g"
3617 func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
3618 $SED -e "$lt_replace_pathsep_nix_to_dos"`
3620 # Now, add the leading and trailing path separators back
3622 :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
3626 *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
3633 # end: func_to_host_pathlist
3635 # func_emit_cwrapperexe_src
3636 # emit the source code for a wrapper executable on stdout
3637 # Must ONLY be called from within func_mode_link because
3638 # it depends on a number of variable set therein.
3639 func_emit_cwrapperexe_src ()
3643 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
3644 Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
3646 The $output program cannot be directly executed until all the libtool
3647 libraries that it depends on are installed.
3649 This wrapper executable should never be moved out of the build directory.
3650 If it is, it will not operate correctly.
3652 Currently, it simply execs the wrapper *script* "$SHELL $output",
3653 but could eventually absorb all of the scripts functionality and
3654 exec $objdir/$outputname directly.
3661 # include <direct.h>
3662 # include <process.h>
3664 # define setmode _setmode
3666 # include <unistd.h>
3667 # include <stdint.h>
3670 # define HAVE_SETENV
3671 # ifdef __STRICT_ANSI__
3672 char *realpath (const char *, char *);
3673 int putenv (char *);
3674 int setenv (const char *, const char *, int);
3685 #include <sys/stat.h>
3687 #if defined(PATH_MAX)
3688 # define LT_PATHMAX PATH_MAX
3689 #elif defined(MAXPATHLEN)
3690 # define LT_PATHMAX MAXPATHLEN
3692 # define LT_PATHMAX 1024
3703 # define S_IXUSR _S_IEXEC
3705 # ifndef _INTPTR_T_DEFINED
3706 # define intptr_t int
3710 #ifndef DIR_SEPARATOR
3711 # define DIR_SEPARATOR '/'
3712 # define PATH_SEPARATOR ':'
3715 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
3717 # define HAVE_DOS_BASED_FILE_SYSTEM
3718 # define FOPEN_WB "wb"
3719 # ifndef DIR_SEPARATOR_2
3720 # define DIR_SEPARATOR_2 '\\'
3722 # ifndef PATH_SEPARATOR_2
3723 # define PATH_SEPARATOR_2 ';'
3727 #ifndef DIR_SEPARATOR_2
3728 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
3729 #else /* DIR_SEPARATOR_2 */
3730 # define IS_DIR_SEPARATOR(ch) \
3731 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
3732 #endif /* DIR_SEPARATOR_2 */
3734 #ifndef PATH_SEPARATOR_2
3735 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
3736 #else /* PATH_SEPARATOR_2 */
3737 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
3738 #endif /* PATH_SEPARATOR_2 */
3741 # define FOPEN_WB "wb"
3745 # define FOPEN_WB "w"
3748 # define _O_BINARY 0
3751 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
3752 #define XFREE(stale) do { \
3753 if (stale) { free ((void *) stale); stale = 0; } \
3756 #undef LTWRAPPER_DEBUGPRINTF
3757 #if defined DEBUGWRAPPER
3758 # define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
3760 ltwrapper_debugprintf (const char *fmt, ...)
3763 va_start (args, fmt);
3764 (void) vfprintf (stderr, fmt, args);
3768 # define LTWRAPPER_DEBUGPRINTF(args)
3771 const char *program_name = NULL;
3773 void *xmalloc (size_t num);
3774 char *xstrdup (const char *string);
3775 const char *base_name (const char *name);
3776 char *find_executable (const char *wrapper);
3777 char *chase_symlinks (const char *pathspec);
3778 int make_executable (const char *path);
3779 int check_executable (const char *path);
3780 char *strendzap (char *str, const char *pat);
3781 void lt_fatal (const char *message, ...);
3782 void lt_setenv (const char *name, const char *value);
3783 char *lt_extend_str (const char *orig_value, const char *add, int to_end);
3784 void lt_opt_process_env_set (const char *arg);
3785 void lt_opt_process_env_prepend (const char *arg);
3786 void lt_opt_process_env_append (const char *arg);
3787 int lt_split_name_value (const char *arg, char** name, char** value);
3788 void lt_update_exe_path (const char *name, const char *value);
3789 void lt_update_lib_path (const char *name, const char *value);
3791 static const char *script_text_part1 =
3794 func_emit_wrapper_part1 yes |
3795 $SED -e 's/\([\\"]\)/\\\1/g' \
3796 -e 's/^/ "/' -e 's/$/\\n"/'
3800 static const char *script_text_part2 =
3802 func_emit_wrapper_part2 yes |
3803 $SED -e 's/\([\\"]\)/\\\1/g' \
3804 -e 's/^/ "/' -e 's/$/\\n"/'
3808 const char * MAGIC_EXE = "$magic_exe";
3809 const char * LIB_PATH_VARNAME = "$shlibpath_var";
3812 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3813 func_to_host_pathlist "$temp_rpath"
3815 const char * LIB_PATH_VALUE = "$func_to_host_pathlist_result";
3819 const char * LIB_PATH_VALUE = "";
3823 if test -n "$dllsearchpath"; then
3824 func_to_host_pathlist "$dllsearchpath:"
3826 const char * EXE_PATH_VARNAME = "PATH";
3827 const char * EXE_PATH_VALUE = "$func_to_host_pathlist_result";
3831 const char * EXE_PATH_VARNAME = "";
3832 const char * EXE_PATH_VALUE = "";
3836 if test "$fast_install" = yes; then
3838 const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
3842 const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
3849 #define LTWRAPPER_OPTION_PREFIX "--lt-"
3850 #define LTWRAPPER_OPTION_PREFIX_LENGTH 5
3852 static const size_t opt_prefix_len = LTWRAPPER_OPTION_PREFIX_LENGTH;
3853 static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
3855 static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
3857 static const size_t env_set_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
3858 static const char *env_set_opt = LTWRAPPER_OPTION_PREFIX "env-set";
3859 /* argument is putenv-style "foo=bar", value of foo is set to bar */
3861 static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
3862 static const char *env_prepend_opt = LTWRAPPER_OPTION_PREFIX "env-prepend";
3863 /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */
3865 static const size_t env_append_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
3866 static const char *env_append_opt = LTWRAPPER_OPTION_PREFIX "env-append";
3867 /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
3870 main (int argc, char *argv[])
3875 char *actual_cwrapper_path;
3876 char *actual_cwrapper_name;
3879 intptr_t rval = 127;
3883 program_name = (char *) xstrdup (base_name (argv[0]));
3884 LTWRAPPER_DEBUGPRINTF (("(main) argv[0] : %s\n", argv[0]));
3885 LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
3887 /* very simple arg parsing; don't want to rely on getopt */
3888 for (i = 1; i < argc; i++)
3890 if (strcmp (argv[i], dumpscript_opt) == 0)
3894 *mingw* | *cygwin* )
3895 # make stdout use "unix" line endings
3896 echo " setmode(1,_O_BINARY);"
3901 printf ("%s", script_text_part1);
3902 printf ("%s", script_text_part2);
3907 newargz = XMALLOC (char *, argc + 1);
3908 tmp_pathspec = find_executable (argv[0]);
3909 if (tmp_pathspec == NULL)
3910 lt_fatal ("Couldn't find %s", argv[0]);
3911 LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
3914 actual_cwrapper_path = chase_symlinks (tmp_pathspec);
3915 LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
3916 actual_cwrapper_path));
3917 XFREE (tmp_pathspec);
3919 actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
3920 strendzap (actual_cwrapper_path, actual_cwrapper_name);
3922 /* wrapper name transforms */
3923 strendzap (actual_cwrapper_name, ".exe");
3924 tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
3925 XFREE (actual_cwrapper_name);
3926 actual_cwrapper_name = tmp_pathspec;
3929 /* target_name transforms -- use actual target program name; might have lt- prefix */
3930 target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
3931 strendzap (target_name, ".exe");
3932 tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
3933 XFREE (target_name);
3934 target_name = tmp_pathspec;
3937 LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
3943 XMALLOC (char, (strlen (actual_cwrapper_path) +
3944 strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
3945 strcpy (newargz[0], actual_cwrapper_path);
3946 strcat (newargz[0], "$objdir");
3947 strcat (newargz[0], "/");
3951 /* stop here, and copy so we don't have to do this twice */
3952 tmp_pathspec = xstrdup (newargz[0]);
3954 /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
3955 strcat (newargz[0], actual_cwrapper_name);
3957 /* DO want the lt- prefix here if it exists, so use target_name */
3958 lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
3959 XFREE (tmp_pathspec);
3960 tmp_pathspec = NULL;
3968 while ((p = strchr (newargz[0], '\\')) != NULL)
3972 while ((p = strchr (lt_argv_zero, '\\')) != NULL)
3982 XFREE (target_name);
3983 XFREE (actual_cwrapper_path);
3984 XFREE (actual_cwrapper_name);
3986 lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
3987 lt_setenv ("DUALCASE", "1"); /* for MSK sh */
3988 lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
3989 lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
3992 for (i = 1; i < argc; i++)
3994 if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
3996 if (argv[i][env_set_opt_len] == '=')
3998 const char *p = argv[i] + env_set_opt_len + 1;
3999 lt_opt_process_env_set (p);
4001 else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
4003 lt_opt_process_env_set (argv[++i]); /* don't copy */
4006 lt_fatal ("%s missing required argument", env_set_opt);
4009 if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
4011 if (argv[i][env_prepend_opt_len] == '=')
4013 const char *p = argv[i] + env_prepend_opt_len + 1;
4014 lt_opt_process_env_prepend (p);
4016 else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
4018 lt_opt_process_env_prepend (argv[++i]); /* don't copy */
4021 lt_fatal ("%s missing required argument", env_prepend_opt);
4024 if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
4026 if (argv[i][env_append_opt_len] == '=')
4028 const char *p = argv[i] + env_append_opt_len + 1;
4029 lt_opt_process_env_append (p);
4031 else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
4033 lt_opt_process_env_append (argv[++i]); /* don't copy */
4036 lt_fatal ("%s missing required argument", env_append_opt);
4039 if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
4041 /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
4042 namespace, but it is not one of the ones we know about and
4043 have already dealt with, above (inluding dump-script), then
4044 report an error. Otherwise, targets might begin to believe
4045 they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
4046 namespace. The first time any user complains about this, we'll
4047 need to make LTWRAPPER_OPTION_PREFIX a configure-time option
4048 or a configure.ac-settable value.
4050 lt_fatal ("Unrecognized option in %s namespace: '%s'",
4051 ltwrapper_option_prefix, argv[i]);
4054 newargz[++newargc] = xstrdup (argv[i]);
4056 newargz[++newargc] = NULL;
4058 LTWRAPPER_DEBUGPRINTF (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
4059 for (i = 0; i < newargc; i++)
4061 LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
4069 /* execv doesn't actually work on mingw as expected on unix */
4070 rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
4073 /* failed to start process */
4074 LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
4082 execv (lt_argv_zero, newargz);
4083 return rval; /* =127, but avoids unused variable warning */
4092 xmalloc (size_t num)
4094 void *p = (void *) malloc (num);
4096 lt_fatal ("Memory exhausted");
4102 xstrdup (const char *string)
4104 return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
4109 base_name (const char *name)
4113 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4114 /* Skip over the disk name in MSDOS pathnames. */
4115 if (isalpha ((unsigned char) name[0]) && name[1] == ':')
4119 for (base = name; *name; name++)
4120 if (IS_DIR_SEPARATOR (*name))
4126 check_executable (const char *path)
4130 LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n",
4131 path ? (*path ? path : "EMPTY!") : "NULL!"));
4132 if ((!path) || (!*path))
4135 if ((stat (path, &st) >= 0)
4136 && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
4143 make_executable (const char *path)
4148 LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n",
4149 path ? (*path ? path : "EMPTY!") : "NULL!"));
4150 if ((!path) || (!*path))
4153 if (stat (path, &st) >= 0)
4155 rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
4160 /* Searches for the full path of the wrapper. Returns
4161 newly allocated full path name if found, NULL otherwise
4162 Does not chase symlinks, even on platforms that support them.
4165 find_executable (const char *wrapper)
4170 /* static buffer for getcwd */
4171 char tmp[LT_PATHMAX + 1];
4175 LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n",
4176 wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
4178 if ((wrapper == NULL) || (*wrapper == '\0'))
4181 /* Absolute path? */
4182 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4183 if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
4185 concat_name = xstrdup (wrapper);
4186 if (check_executable (concat_name))
4188 XFREE (concat_name);
4193 if (IS_DIR_SEPARATOR (wrapper[0]))
4195 concat_name = xstrdup (wrapper);
4196 if (check_executable (concat_name))
4198 XFREE (concat_name);
4200 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4204 for (p = wrapper; *p; p++)
4212 /* no slashes; search PATH */
4213 const char *path = getenv ("PATH");
4216 for (p = path; *p; p = p_next)
4220 for (q = p; *q; q++)
4221 if (IS_PATH_SEPARATOR (*q))
4224 p_next = (*q == '\0' ? q : q + 1);
4227 /* empty path: current directory */
4228 if (getcwd (tmp, LT_PATHMAX) == NULL)
4229 lt_fatal ("getcwd failed");
4230 tmp_len = strlen (tmp);
4232 XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
4233 memcpy (concat_name, tmp, tmp_len);
4234 concat_name[tmp_len] = '/';
4235 strcpy (concat_name + tmp_len + 1, wrapper);
4240 XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
4241 memcpy (concat_name, p, p_len);
4242 concat_name[p_len] = '/';
4243 strcpy (concat_name + p_len + 1, wrapper);
4245 if (check_executable (concat_name))
4247 XFREE (concat_name);
4250 /* not found in PATH; assume curdir */
4252 /* Relative path | not found in path: prepend cwd */
4253 if (getcwd (tmp, LT_PATHMAX) == NULL)
4254 lt_fatal ("getcwd failed");
4255 tmp_len = strlen (tmp);
4256 concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
4257 memcpy (concat_name, tmp, tmp_len);
4258 concat_name[tmp_len] = '/';
4259 strcpy (concat_name + tmp_len + 1, wrapper);
4261 if (check_executable (concat_name))
4263 XFREE (concat_name);
4268 chase_symlinks (const char *pathspec)
4271 return xstrdup (pathspec);
4273 char buf[LT_PATHMAX];
4275 char *tmp_pathspec = xstrdup (pathspec);
4277 int has_symlinks = 0;
4278 while (strlen (tmp_pathspec) && !has_symlinks)
4280 LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
4282 if (lstat (tmp_pathspec, &s) == 0)
4284 if (S_ISLNK (s.st_mode) != 0)
4290 /* search backwards for last DIR_SEPARATOR */
4291 p = tmp_pathspec + strlen (tmp_pathspec) - 1;
4292 while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
4294 if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
4296 /* no more DIR_SEPARATORS left */
4303 char *errstr = strerror (errno);
4304 lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
4307 XFREE (tmp_pathspec);
4311 return xstrdup (pathspec);
4314 tmp_pathspec = realpath (pathspec, buf);
4315 if (tmp_pathspec == 0)
4317 lt_fatal ("Could not follow symlinks for %s", pathspec);
4319 return xstrdup (tmp_pathspec);
4324 strendzap (char *str, const char *pat)
4328 assert (str != NULL);
4329 assert (pat != NULL);
4332 patlen = strlen (pat);
4336 str += len - patlen;
4337 if (strcmp (str, pat) == 0)
4344 lt_error_core (int exit_status, const char *mode,
4345 const char *message, va_list ap)
4347 fprintf (stderr, "%s: %s: ", program_name, mode);
4348 vfprintf (stderr, message, ap);
4349 fprintf (stderr, ".\n");
4351 if (exit_status >= 0)
4356 lt_fatal (const char *message, ...)
4359 va_start (ap, message);
4360 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4365 lt_setenv (const char *name, const char *value)
4367 LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
4368 (name ? name : "<NULL>"),
4369 (value ? value : "<NULL>")));
4372 /* always make a copy, for consistency with !HAVE_SETENV */
4373 char *str = xstrdup (value);
4374 setenv (name, str, 1);
4376 int len = strlen (name) + 1 + strlen (value) + 1;
4377 char *str = XMALLOC (char, len);
4378 sprintf (str, "%s=%s", name, value);
4379 if (putenv (str) != EXIT_SUCCESS)
4388 lt_extend_str (const char *orig_value, const char *add, int to_end)
4391 if (orig_value && *orig_value)
4393 int orig_value_len = strlen (orig_value);
4394 int add_len = strlen (add);
4395 new_value = XMALLOC (char, add_len + orig_value_len + 1);
4398 strcpy (new_value, orig_value);
4399 strcpy (new_value + orig_value_len, add);
4403 strcpy (new_value, add);
4404 strcpy (new_value + add_len, orig_value);
4409 new_value = xstrdup (add);
4415 lt_split_name_value (const char *arg, char** name, char** value)
4422 p = strchr (arg, (int)'=');
4427 *value = xstrdup (++p);
4429 len = strlen (arg) - strlen (*value);
4430 *name = XMALLOC (char, len);
4431 strncpy (*name, arg, len-1);
4432 (*name)[len - 1] = '\0';
4438 lt_opt_process_env_set (const char *arg)
4443 if (lt_split_name_value (arg, &name, &value) != 0)
4447 lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);
4450 lt_setenv (name, value);
4456 lt_opt_process_env_prepend (const char *arg)
4460 char *new_value = NULL;
4462 if (lt_split_name_value (arg, &name, &value) != 0)
4466 lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
4469 new_value = lt_extend_str (getenv (name), value, 0);
4470 lt_setenv (name, new_value);
4477 lt_opt_process_env_append (const char *arg)
4481 char *new_value = NULL;
4483 if (lt_split_name_value (arg, &name, &value) != 0)
4487 lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
4490 new_value = lt_extend_str (getenv (name), value, 1);
4491 lt_setenv (name, new_value);
4498 lt_update_exe_path (const char *name, const char *value)
4500 LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
4501 (name ? name : "<NULL>"),
4502 (value ? value : "<NULL>")));
4504 if (name && *name && value && *value)
4506 char *new_value = lt_extend_str (getenv (name), value, 0);
4507 /* some systems can't cope with a ':'-terminated path #' */
4508 int len = strlen (new_value);
4509 while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
4511 new_value[len-1] = '\0';
4513 lt_setenv (name, new_value);
4519 lt_update_lib_path (const char *name, const char *value)
4521 LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
4522 (name ? name : "<NULL>"),
4523 (value ? value : "<NULL>")));
4525 if (name && *name && value && *value)
4527 char *new_value = lt_extend_str (getenv (name), value, 0);
4528 lt_setenv (name, new_value);
4536 # end: func_emit_cwrapperexe_src
4538 # func_mode_link arg...
4543 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
4544 # It is impossible to link a dll without this setting, and
4545 # we shouldn't force the makefile maintainer to figure out
4546 # which system we are compiling for in order to pass an extra
4547 # flag for every libtool invocation.
4548 # allow_undefined=no
4550 # FIXME: Unfortunately, there are problems with the above when trying
4551 # to make a dll which has undefined symbols, in which case not
4552 # even a static library is built. For now, we need to specify
4553 # -no-undefined on the libtool link line when we can be certain
4554 # that all symbols are satisfied, otherwise we get a static library.
4561 libtool_args=$nonopt
4562 base_compile="$nonopt $@"
4563 compile_command=$nonopt
4564 finalize_command=$nonopt
4577 lib_search_path=`pwd`
4579 new_inherited_linker_flags=
4587 export_symbols_regex=
4595 precious_files_regex=
4596 prefer_static_libs=no
4609 single_module="${wl}-single_module"
4610 func_infer_tag $base_compile
4612 # We need to know -static, to get the right output filenames.
4617 test "$build_libtool_libs" != yes && \
4618 func_fatal_configuration "can not build a shared library"
4622 -all-static | -static | -static-libtool-libs)
4625 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
4626 func_warning "complete static linking is impossible in this configuration"
4628 if test -n "$link_static_flag"; then
4629 dlopen_self=$dlopen_self_static
4631 prefer_static_libs=yes
4634 if test -z "$pic_flag" && test -n "$link_static_flag"; then
4635 dlopen_self=$dlopen_self_static
4637 prefer_static_libs=built
4639 -static-libtool-libs)
4640 if test -z "$pic_flag" && test -n "$link_static_flag"; then
4641 dlopen_self=$dlopen_self_static
4643 prefer_static_libs=yes
4646 build_libtool_libs=no
4653 # See if our shared archives depend on static archives.
4654 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
4656 # Go through the arguments, transforming them on the way.
4657 while test "$#" -gt 0; do
4660 func_quote_for_eval "$arg"
4661 qarg=$func_quote_for_eval_unquoted_result
4662 func_append libtool_args " $func_quote_for_eval_result"
4664 # If the previous option needs an argument, assign it.
4665 if test -n "$prev"; then
4668 func_append compile_command " @OUTPUT@"
4669 func_append finalize_command " @OUTPUT@"
4675 if test "$preload" = no; then
4676 # Add the symbol object into the linking commands.
4677 func_append compile_command " @SYMFILE@"
4678 func_append finalize_command " @SYMFILE@"
4682 *.la | *.lo) ;; # We handle these cases below.
4684 if test "$dlself" = no; then
4692 if test "$prev" = dlprefiles; then
4694 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
4704 if test "$prev" = dlfiles; then
4705 dlfiles="$dlfiles $arg"
4707 dlprefiles="$dlprefiles $arg"
4715 export_symbols="$arg"
4717 || func_fatal_error "symbol file \`$arg' does not exist"
4722 export_symbols_regex="$arg"
4730 *" $qarg.ltframework "*) ;;
4731 *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
4740 inst_prefix_dir="$arg"
4745 if test -f "$arg"; then
4748 for fil in `cat "$save_arg"`
4750 # moreargs="$moreargs $fil"
4752 # A libtool-controlled object.
4754 # Check to see that this really is a libtool object.
4755 if func_lalib_unsafe_p "$arg"; then
4762 if test -z "$pic_object" ||
4763 test -z "$non_pic_object" ||
4764 test "$pic_object" = none &&
4765 test "$non_pic_object" = none; then
4766 func_fatal_error "cannot find name of object for \`$arg'"
4769 # Extract subdirectory from the argument.
4770 func_dirname "$arg" "/" ""
4771 xdir="$func_dirname_result"
4773 if test "$pic_object" != none; then
4774 # Prepend the subdirectory the object is found in.
4775 pic_object="$xdir$pic_object"
4777 if test "$prev" = dlfiles; then
4778 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
4779 dlfiles="$dlfiles $pic_object"
4783 # If libtool objects are unsupported, then we need to preload.
4788 # CHECK ME: I think I busted this. -Ossama
4789 if test "$prev" = dlprefiles; then
4790 # Preload the old-style object.
4791 dlprefiles="$dlprefiles $pic_object"
4796 func_append libobjs " $pic_object"
4801 if test "$non_pic_object" != none; then
4802 # Prepend the subdirectory the object is found in.
4803 non_pic_object="$xdir$non_pic_object"
4805 # A standard non-PIC object
4806 func_append non_pic_objects " $non_pic_object"
4807 if test -z "$pic_object" || test "$pic_object" = none ; then
4808 arg="$non_pic_object"
4811 # If the PIC object exists, use it instead.
4812 # $xdir was prepended to $pic_object above.
4813 non_pic_object="$pic_object"
4814 func_append non_pic_objects " $non_pic_object"
4817 # Only an error if not doing a dry-run.
4818 if $opt_dry_run; then
4819 # Extract subdirectory from the argument.
4820 func_dirname "$arg" "/" ""
4821 xdir="$func_dirname_result"
4824 pic_object=$xdir$objdir/$func_lo2o_result
4825 non_pic_object=$xdir$func_lo2o_result
4826 func_append libobjs " $pic_object"
4827 func_append non_pic_objects " $non_pic_object"
4829 func_fatal_error "\`$arg' is not a valid libtool object"
4834 func_fatal_error "link input file \`$arg' does not exist"
4841 precious_files_regex="$arg"
4851 # We need an absolute path.
4853 [\\/]* | [A-Za-z]:[\\/]*) ;;
4855 func_fatal_error "only absolute run-paths are allowed"
4858 if test "$prev" = rpath; then
4861 *) rpath="$rpath $arg" ;;
4866 *) xrpath="$xrpath $arg" ;;
4878 weak_libs="$weak_libs $arg"
4883 linker_flags="$linker_flags $qarg"
4884 compiler_flags="$compiler_flags $qarg"
4886 func_append compile_command " $qarg"
4887 func_append finalize_command " $qarg"
4891 compiler_flags="$compiler_flags $qarg"
4893 func_append compile_command " $qarg"
4894 func_append finalize_command " $qarg"
4898 linker_flags="$linker_flags $qarg"
4899 compiler_flags="$compiler_flags $wl$qarg"
4901 func_append compile_command " $wl$qarg"
4902 func_append finalize_command " $wl$qarg"
4906 eval "$prev=\"\$arg\""
4911 fi # test -n "$prev"
4917 if test -n "$link_static_flag"; then
4918 # See comment for -static flag below, for more details.
4919 func_append compile_command " $link_static_flag"
4920 func_append finalize_command " $link_static_flag"
4926 # FIXME: remove this flag sometime in the future.
4927 func_fatal_error "\`-allow-undefined' must not be used because it is the default"
4950 -export-symbols | -export-symbols-regex)
4951 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
4952 func_fatal_error "more than one -exported-symbols argument is not allowed"
4954 if test "X$arg" = "X-export-symbols"; then
4972 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
4973 # so, if we see these flags be careful not to treat them like -L
4975 case $with_gcc/$host in
4976 no/*-*-irix* | /*-*-irix*)
4977 func_append compile_command " $arg"
4978 func_append finalize_command " $arg"
4985 func_stripname '-L' '' "$arg"
4986 dir=$func_stripname_result
4987 if test -z "$dir"; then
4988 if test "$#" -gt 0; then
4989 func_fatal_error "require no space between \`-L' and \`$1'"
4991 func_fatal_error "need path for \`-L' option"
4994 # We need an absolute path.
4996 [\\/]* | [A-Za-z]:[\\/]*) ;;
4998 absdir=`cd "$dir" && pwd`
4999 test -z "$absdir" && \
5000 func_fatal_error "cannot determine absolute directory name of \`$dir'"
5007 deplibs="$deplibs -L$dir"
5008 lib_search_path="$lib_search_path $dir"
5012 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
5013 testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
5014 case :$dllsearchpath: in
5016 ::) dllsearchpath=$dir;;
5017 *) dllsearchpath="$dllsearchpath:$dir";;
5019 case :$dllsearchpath: in
5020 *":$testbindir:"*) ;;
5021 ::) dllsearchpath=$testbindir;;
5022 *) dllsearchpath="$dllsearchpath:$testbindir";;
5030 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
5032 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
5033 # These systems don't actually have a C or math library (as such)
5037 # These systems don't actually have a C library (as such)
5038 test "X$arg" = "X-lc" && continue
5040 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
5041 # Do not include libc due to us having libc/libc_r.
5042 test "X$arg" = "X-lc" && continue
5044 *-*-rhapsody* | *-*-darwin1.[012])
5045 # Rhapsody C and math libraries are in the System framework
5046 deplibs="$deplibs System.ltframework"
5049 *-*-sco3.2v5* | *-*-sco5v6*)
5050 # Causes problems with __ctype
5051 test "X$arg" = "X-lc" && continue
5053 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
5054 # Compiler inserts libc in the correct place for threads to work
5055 test "X$arg" = "X-lc" && continue
5058 elif test "X$arg" = "X-lc_r"; then
5060 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
5061 # Do not include libc_r directly, use -pthread flag.
5066 deplibs="$deplibs $arg"
5075 # Tru64 UNIX uses -model [arg] to determine the layout of C++
5076 # classes, name mangling, and exception handling.
5077 # Darwin uses the -arch flag to determine output architecture.
5078 -model|-arch|-isysroot)
5079 compiler_flags="$compiler_flags $arg"
5080 func_append compile_command " $arg"
5081 func_append finalize_command " $arg"
5086 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
5087 compiler_flags="$compiler_flags $arg"
5088 func_append compile_command " $arg"
5089 func_append finalize_command " $arg"
5090 case "$new_inherited_linker_flags " in
5092 * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
5098 single_module="${wl}-multi_module"
5109 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
5110 # The PATH hackery in wrapper scripts is required on Windows
5111 # and Darwin in order for the loader to find any dlls it needs.
5112 func_warning "\`-no-install' is ignored for $host"
5113 func_warning "assuming \`-no-fast-install' instead"
5116 *) no_install=yes ;;
5133 -precious-files-regex)
5154 func_stripname '-R' '' "$arg"
5155 dir=$func_stripname_result
5156 # We need an absolute path.
5158 [\\/]* | [A-Za-z]:[\\/]*) ;;
5160 func_fatal_error "only absolute run-paths are allowed"
5165 *) xrpath="$xrpath $dir" ;;
5171 # The effects of -shared are defined in a previous loop.
5180 -static | -static-libtool-libs)
5181 # The effects of -static are defined in a previous loop.
5182 # We used to do the same as -all-static on platforms that
5183 # didn't have a PIC flag, but the assumption that the effects
5184 # would be equivalent was wrong. It would break on at least
5185 # Digital Unix and AIX.
5211 func_stripname '-Wc,' '' "$arg"
5212 args=$func_stripname_result
5214 save_ifs="$IFS"; IFS=','
5215 for flag in $args; do
5217 func_quote_for_eval "$flag"
5218 arg="$arg $wl$func_quote_for_eval_result"
5219 compiler_flags="$compiler_flags $func_quote_for_eval_result"
5222 func_stripname ' ' '' "$arg"
5223 arg=$func_stripname_result
5227 func_stripname '-Wl,' '' "$arg"
5228 args=$func_stripname_result
5230 save_ifs="$IFS"; IFS=','
5231 for flag in $args; do
5233 func_quote_for_eval "$flag"
5234 arg="$arg $wl$func_quote_for_eval_result"
5235 compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
5236 linker_flags="$linker_flags $func_quote_for_eval_result"
5239 func_stripname ' ' '' "$arg"
5240 arg=$func_stripname_result
5260 func_quote_for_eval "$arg"
5261 arg="$func_quote_for_eval_result"
5264 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
5265 # -r[0-9][0-9]* specifies the processor on the SGI compiler
5266 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
5267 # +DA*, +DD* enable 64-bit mode on the HP compiler
5268 # -q* pass through compiler args for the IBM compiler
5269 # -m*, -t[45]*, -txscale* pass through architecture-specific
5270 # compiler args for GCC
5271 # -F/path gives path to uninstalled frameworks, gcc on darwin
5272 # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
5273 # @file GCC response files
5274 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
5275 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
5276 func_quote_for_eval "$arg"
5277 arg="$func_quote_for_eval_result"
5278 func_append compile_command " $arg"
5279 func_append finalize_command " $arg"
5280 compiler_flags="$compiler_flags $arg"
5284 # Some other compiler flag.
5286 func_quote_for_eval "$arg"
5287 arg="$func_quote_for_eval_result"
5291 # A standard object.
5296 # A libtool-controlled object.
5298 # Check to see that this really is a libtool object.
5299 if func_lalib_unsafe_p "$arg"; then
5306 if test -z "$pic_object" ||
5307 test -z "$non_pic_object" ||
5308 test "$pic_object" = none &&
5309 test "$non_pic_object" = none; then
5310 func_fatal_error "cannot find name of object for \`$arg'"
5313 # Extract subdirectory from the argument.
5314 func_dirname "$arg" "/" ""
5315 xdir="$func_dirname_result"
5317 if test "$pic_object" != none; then
5318 # Prepend the subdirectory the object is found in.
5319 pic_object="$xdir$pic_object"
5321 if test "$prev" = dlfiles; then
5322 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
5323 dlfiles="$dlfiles $pic_object"
5327 # If libtool objects are unsupported, then we need to preload.
5332 # CHECK ME: I think I busted this. -Ossama
5333 if test "$prev" = dlprefiles; then
5334 # Preload the old-style object.
5335 dlprefiles="$dlprefiles $pic_object"
5340 func_append libobjs " $pic_object"
5345 if test "$non_pic_object" != none; then
5346 # Prepend the subdirectory the object is found in.
5347 non_pic_object="$xdir$non_pic_object"
5349 # A standard non-PIC object
5350 func_append non_pic_objects " $non_pic_object"
5351 if test -z "$pic_object" || test "$pic_object" = none ; then
5352 arg="$non_pic_object"
5355 # If the PIC object exists, use it instead.
5356 # $xdir was prepended to $pic_object above.
5357 non_pic_object="$pic_object"
5358 func_append non_pic_objects " $non_pic_object"
5361 # Only an error if not doing a dry-run.
5362 if $opt_dry_run; then
5363 # Extract subdirectory from the argument.
5364 func_dirname "$arg" "/" ""
5365 xdir="$func_dirname_result"
5368 pic_object=$xdir$objdir/$func_lo2o_result
5369 non_pic_object=$xdir$func_lo2o_result
5370 func_append libobjs " $pic_object"
5371 func_append non_pic_objects " $non_pic_object"
5373 func_fatal_error "\`$arg' is not a valid libtool object"
5380 deplibs="$deplibs $arg"
5381 old_deplibs="$old_deplibs $arg"
5386 # A libtool-controlled library.
5388 if test "$prev" = dlfiles; then
5389 # This library was specified with -dlopen.
5390 dlfiles="$dlfiles $arg"
5392 elif test "$prev" = dlprefiles; then
5393 # The library was specified with -dlpreopen.
5394 dlprefiles="$dlprefiles $arg"
5397 deplibs="$deplibs $arg"
5402 # Some other compiler argument.
5404 # Unknown arguments in both finalize_command and compile_command need
5405 # to be aesthetically quoted because they are evaled later.
5406 func_quote_for_eval "$arg"
5407 arg="$func_quote_for_eval_result"
5411 # Now actually substitute the argument into the commands.
5412 if test -n "$arg"; then
5413 func_append compile_command " $arg"
5414 func_append finalize_command " $arg"
5416 done # argument parsing loop
5418 test -n "$prev" && \
5419 func_fatal_help "the \`$prevarg' option requires an argument"
5421 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
5422 eval arg=\"$export_dynamic_flag_spec\"
5423 func_append compile_command " $arg"
5424 func_append finalize_command " $arg"
5428 # calculate the name of the file, without its directory
5429 func_basename "$output"
5430 outputname="$func_basename_result"
5431 libobjs_save="$libobjs"
5433 if test -n "$shlibpath_var"; then
5434 # get the directories listed in $shlibpath_var
5435 eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
5439 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
5440 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
5442 func_dirname "$output" "/" ""
5443 output_objdir="$func_dirname_result$objdir"
5444 # Create the object directory.
5445 func_mkdir_p "$output_objdir"
5447 # Determine the type of output
5450 func_fatal_help "you must specify an output file"
5452 *.$libext) linkmode=oldlib ;;
5453 *.lo | *.$objext) linkmode=obj ;;
5454 *.la) linkmode=lib ;;
5455 *) linkmode=prog ;; # Anything else should be a program.
5461 # Find all interdependent deplibs by searching for libraries
5462 # that are linked more than once (e.g. -la -lb -la)
5463 for deplib in $deplibs; do
5464 if $opt_duplicate_deps ; then
5466 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
5469 libs="$libs $deplib"
5472 if test "$linkmode" = lib; then
5473 libs="$predeps $libs $compiler_lib_search_path $postdeps"
5475 # Compute libraries that are listed more than once in $predeps
5476 # $postdeps and mark them as special (i.e., whose duplicates are
5477 # not to be eliminated).
5479 if $opt_duplicate_compiler_generated_deps; then
5480 for pre_post_dep in $predeps $postdeps; do
5481 case "$pre_post_deps " in
5482 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
5484 pre_post_deps="$pre_post_deps $pre_post_dep"
5493 need_relink=no # whether we're linking any uninstalled libtool libraries
5494 notinst_deplibs= # not-installed libtool libraries
5495 notinst_path= # paths that contain not-installed libtool libraries
5499 passes="conv dlpreopen link"
5500 for file in $dlfiles $dlprefiles; do
5504 func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
5515 passes="conv scan dlopen dlpreopen link"
5521 for pass in $passes; do
5522 # The preopen pass in lib mode reverses $deplibs; put it back here
5523 # so that -L comes before libs that need it for instance...
5524 if test "$linkmode,$pass" = "lib,link"; then
5525 ## FIXME: Find the place where the list is rebuilt in the wrong
5526 ## order, and fix it there properly
5528 for deplib in $deplibs; do
5529 tmp_deplibs="$deplib $tmp_deplibs"
5531 deplibs="$tmp_deplibs"
5534 if test "$linkmode,$pass" = "lib,link" ||
5535 test "$linkmode,$pass" = "prog,scan"; then
5539 if test "$linkmode" = prog; then
5541 dlopen) libs="$dlfiles" ;;
5542 dlpreopen) libs="$dlprefiles" ;;
5544 libs="$deplibs %DEPLIBS%"
5545 test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
5549 if test "$linkmode,$pass" = "lib,dlpreopen"; then
5550 # Collect and forward deplibs of preopened libtool libs
5551 for lib in $dlprefiles; do
5552 # Ignore non-libtool-libs
5555 *.la) func_source "$lib" ;;
5558 # Collect preopened libtool deplibs, except any this library
5559 # has declared as weak libs
5560 for deplib in $dependency_libs; do
5561 deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
5562 case " $weak_libs " in
5563 *" $deplib_base "*) ;;
5564 *) deplibs="$deplibs $deplib" ;;
5570 if test "$pass" = dlopen; then
5571 # Collect dlpreopened libraries
5572 save_deplibs="$deplibs"
5576 for deplib in $libs; do
5580 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
5581 if test "$linkmode,$pass" = "prog,link"; then
5582 compile_deplibs="$deplib $compile_deplibs"
5583 finalize_deplibs="$deplib $finalize_deplibs"
5585 compiler_flags="$compiler_flags $deplib"
5586 if test "$linkmode" = lib ; then
5587 case "$new_inherited_linker_flags " in
5589 * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
5596 if test "$linkmode" != lib && test "$linkmode" != prog; then
5597 func_warning "\`-l' is ignored for archives/objects"
5600 func_stripname '-l' '' "$deplib"
5601 name=$func_stripname_result
5602 if test "$linkmode" = lib; then
5603 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
5605 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
5607 for searchdir in $searchdirs; do
5608 for search_ext in .la $std_shrext .so .a; do
5609 # Search the libtool library
5610 lib="$searchdir/lib${name}${search_ext}"
5611 if test -f "$lib"; then
5612 if test "$search_ext" = ".la"; then
5621 if test "$found" != yes; then
5622 # deplib doesn't seem to be a libtool library
5623 if test "$linkmode,$pass" = "prog,link"; then
5624 compile_deplibs="$deplib $compile_deplibs"
5625 finalize_deplibs="$deplib $finalize_deplibs"
5627 deplibs="$deplib $deplibs"
5628 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
5631 else # deplib is a libtool library
5632 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
5633 # We need to do some special things here, and not later.
5634 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
5635 case " $predeps $postdeps " in
5637 if func_lalib_p "$lib"; then
5641 for l in $old_library $library_names; do
5644 if test "X$ll" = "X$old_library" ; then # only static version available
5646 func_dirname "$lib" "" "."
5647 ladir="$func_dirname_result"
5648 lib=$ladir/$old_library
5649 if test "$linkmode,$pass" = "prog,link"; then
5650 compile_deplibs="$deplib $compile_deplibs"
5651 finalize_deplibs="$deplib $finalize_deplibs"
5653 deplibs="$deplib $deplibs"
5654 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
5666 if test "$linkmode,$pass" = "prog,link"; then
5667 compile_deplibs="$deplib $compile_deplibs"
5668 finalize_deplibs="$deplib $finalize_deplibs"
5670 deplibs="$deplib $deplibs"
5671 if test "$linkmode" = lib ; then
5672 case "$new_inherited_linker_flags " in
5674 * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
5683 deplibs="$deplib $deplibs"
5684 test "$pass" = conv && continue
5685 newdependency_libs="$deplib $newdependency_libs"
5686 func_stripname '-L' '' "$deplib"
5687 newlib_search_path="$newlib_search_path $func_stripname_result"
5690 if test "$pass" = conv; then
5691 deplibs="$deplib $deplibs"
5694 if test "$pass" = scan; then
5695 deplibs="$deplib $deplibs"
5697 compile_deplibs="$deplib $compile_deplibs"
5698 finalize_deplibs="$deplib $finalize_deplibs"
5700 func_stripname '-L' '' "$deplib"
5701 newlib_search_path="$newlib_search_path $func_stripname_result"
5704 func_warning "\`-L' is ignored for archives/objects"
5710 if test "$pass" = link; then
5711 func_stripname '-R' '' "$deplib"
5712 dir=$func_stripname_result
5713 # Make sure the xrpath contains only unique directories.
5716 *) xrpath="$xrpath $dir" ;;
5719 deplibs="$deplib $deplibs"
5722 *.la) lib="$deplib" ;;
5724 if test "$pass" = conv; then
5725 deplibs="$deplib $deplibs"
5730 # Linking convenience modules into shared libraries is allowed,
5731 # but linking other static libraries is non-portable.
5732 case " $dlpreconveniencelibs " in
5736 case $deplibs_check_method in
5738 set dummy $deplibs_check_method; shift
5739 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
5740 if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
5741 | $EGREP "$match_pattern_regex" > /dev/null; then
5749 if test "$valid_a_lib" != yes; then
5751 $ECHO "*** Warning: Trying to link with static lib archive $deplib."
5752 $ECHO "*** I have the capability to make that library automatically link in when"
5753 $ECHO "*** you link to this library. But I can only do this if you have a"
5754 $ECHO "*** shared version of the library, which you do not appear to have"
5755 $ECHO "*** because the file extensions .$libext of this argument makes me believe"
5756 $ECHO "*** that it is just a static archive that I should not use here."
5759 $ECHO "*** Warning: Linking the shared library $output against the"
5760 $ECHO "*** static library $deplib is not portable!"
5761 deplibs="$deplib $deplibs"
5768 if test "$pass" != link; then
5769 deplibs="$deplib $deplibs"
5771 compile_deplibs="$deplib $compile_deplibs"
5772 finalize_deplibs="$deplib $finalize_deplibs"
5779 if test "$pass" = conv; then
5780 deplibs="$deplib $deplibs"
5781 elif test "$linkmode" = prog; then
5782 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
5783 # If there is no dlopen support or we're linking statically,
5784 # we need to preload.
5785 newdlprefiles="$newdlprefiles $deplib"
5786 compile_deplibs="$deplib $compile_deplibs"
5787 finalize_deplibs="$deplib $finalize_deplibs"
5789 newdlfiles="$newdlfiles $deplib"
5800 if test "$found" = yes || test -f "$lib"; then :
5802 func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
5805 # Check to see that this really is a libtool archive.
5806 func_lalib_unsafe_p "$lib" \
5807 || func_fatal_error "\`$lib' is not a valid libtool archive"
5809 func_dirname "$lib" "" "."
5810 ladir="$func_dirname_result"
5818 inherited_linker_flags=
5819 # If the library was installed with an old release of libtool,
5820 # it will not redefine variables installed, or shouldnotlink
5829 # Convert "-framework foo" to "foo.ltframework"
5830 if test -n "$inherited_linker_flags"; then
5831 tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
5832 for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
5833 case " $new_inherited_linker_flags " in
5834 *" $tmp_inherited_linker_flag "*) ;;
5835 *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
5839 dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
5840 if test "$linkmode,$pass" = "lib,link" ||
5841 test "$linkmode,$pass" = "prog,scan" ||
5842 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
5843 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
5844 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
5847 if test "$pass" = conv; then
5848 # Only check for convenience libraries
5849 deplibs="$lib $deplibs"
5850 if test -z "$libdir"; then
5851 if test -z "$old_library"; then
5852 func_fatal_error "cannot find name of link library for \`$lib'"
5854 # It is a libtool convenience library, so add in its objects.
5855 convenience="$convenience $ladir/$objdir/$old_library"
5856 old_convenience="$old_convenience $ladir/$objdir/$old_library"
5858 for deplib in $dependency_libs; do
5859 deplibs="$deplib $deplibs"
5860 if $opt_duplicate_deps ; then
5861 case "$tmp_libs " in
5862 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
5865 tmp_libs="$tmp_libs $deplib"
5867 elif test "$linkmode" != prog && test "$linkmode" != lib; then
5868 func_fatal_error "\`$lib' is not a convenience library"
5874 # Get the name of the library we link against.
5876 for l in $old_library $library_names; do
5879 if test -z "$linklib"; then
5880 func_fatal_error "cannot find name of link library for \`$lib'"
5883 # This library was specified with -dlopen.
5884 if test "$pass" = dlopen; then
5885 if test -z "$libdir"; then
5886 func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
5888 if test -z "$dlname" ||
5889 test "$dlopen_support" != yes ||
5890 test "$build_libtool_libs" = no; then
5891 # If there is no dlname, no dlopen support or we're linking
5892 # statically, we need to preload. We also need to preload any
5893 # dependent libraries so libltdl's deplib preloader doesn't
5894 # bomb out in the load deplibs phase.
5895 dlprefiles="$dlprefiles $lib $dependency_libs"
5897 newdlfiles="$newdlfiles $lib"
5902 # We need an absolute path.
5904 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
5906 abs_ladir=`cd "$ladir" && pwd`
5907 if test -z "$abs_ladir"; then
5908 func_warning "cannot determine absolute directory name of \`$ladir'"
5909 func_warning "passing it literally to the linker, although it might fail"
5914 func_basename "$lib"
5915 laname="$func_basename_result"
5917 # Find the relevant object directory and library name.
5918 if test "X$installed" = Xyes; then
5919 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
5920 func_warning "library \`$lib' was moved."
5928 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
5930 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
5933 # Remove this search path later
5934 notinst_path="$notinst_path $abs_ladir"
5936 dir="$ladir/$objdir"
5937 absdir="$abs_ladir/$objdir"
5938 # Remove this search path later
5939 notinst_path="$notinst_path $abs_ladir"
5941 fi # $installed = yes
5942 func_stripname 'lib' '.la' "$laname"
5943 name=$func_stripname_result
5945 # This library was specified with -dlpreopen.
5946 if test "$pass" = dlpreopen; then
5947 if test -z "$libdir" && test "$linkmode" = prog; then
5948 func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
5950 # Prefer using a static library (so that no silly _DYNAMIC symbols
5951 # are required to link).
5952 if test -n "$old_library"; then
5953 newdlprefiles="$newdlprefiles $dir/$old_library"
5954 # Keep a list of preopened convenience libraries to check
5955 # that they are being used correctly in the link pass.
5956 test -z "$libdir" && \
5957 dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
5958 # Otherwise, use the dlname, so that lt_dlopen finds it.
5959 elif test -n "$dlname"; then
5960 newdlprefiles="$newdlprefiles $dir/$dlname"
5962 newdlprefiles="$newdlprefiles $dir/$linklib"
5964 fi # $pass = dlpreopen
5966 if test -z "$libdir"; then
5967 # Link the convenience library
5968 if test "$linkmode" = lib; then
5969 deplibs="$dir/$old_library $deplibs"
5970 elif test "$linkmode,$pass" = "prog,link"; then
5971 compile_deplibs="$dir/$old_library $compile_deplibs"
5972 finalize_deplibs="$dir/$old_library $finalize_deplibs"
5974 deplibs="$lib $deplibs" # used for prog,scan pass
5980 if test "$linkmode" = prog && test "$pass" != link; then
5981 newlib_search_path="$newlib_search_path $ladir"
5982 deplibs="$lib $deplibs"
5985 if test "$link_all_deplibs" != no || test -z "$library_names" ||
5986 test "$build_libtool_libs" = no; then
5991 for deplib in $dependency_libs; do
5993 -L*) func_stripname '-L' '' "$deplib"
5994 newlib_search_path="$newlib_search_path $func_stripname_result"
5997 # Need to link against all dependency_libs?
5998 if test "$linkalldeplibs" = yes; then
5999 deplibs="$deplib $deplibs"
6001 # Need to hardcode shared library paths
6002 # or/and link against static libraries
6003 newdependency_libs="$deplib $newdependency_libs"
6005 if $opt_duplicate_deps ; then
6006 case "$tmp_libs " in
6007 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
6010 tmp_libs="$tmp_libs $deplib"
6013 fi # $linkmode = prog...
6015 if test "$linkmode,$pass" = "prog,link"; then
6016 if test -n "$library_names" &&
6017 { { test "$prefer_static_libs" = no ||
6018 test "$prefer_static_libs,$installed" = "built,yes"; } ||
6019 test -z "$old_library"; }; then
6020 # We need to hardcode the library path
6021 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
6022 # Make sure the rpath contains only unique directories.
6023 case "$temp_rpath:" in
6025 *) temp_rpath="$temp_rpath$absdir:" ;;
6029 # Hardcode the library path.
6030 # Skip directories that are in the system default run-time
6032 case " $sys_lib_dlsearch_path " in
6035 case "$compile_rpath " in
6037 *) compile_rpath="$compile_rpath $absdir"
6041 case " $sys_lib_dlsearch_path " in
6044 case "$finalize_rpath " in
6046 *) finalize_rpath="$finalize_rpath $libdir"
6050 fi # $linkmode,$pass = prog,link...
6052 if test "$alldeplibs" = yes &&
6053 { test "$deplibs_check_method" = pass_all ||
6054 { test "$build_libtool_libs" = yes &&
6055 test -n "$library_names"; }; }; then
6056 # We only need to search for static libraries
6061 link_static=no # Whether the deplib will be linked statically
6062 use_static_libs=$prefer_static_libs
6063 if test "$use_static_libs" = built && test "$installed" = yes; then
6066 if test -n "$library_names" &&
6067 { test "$use_static_libs" = no || test -z "$old_library"; }; then
6069 *cygwin* | *mingw* | *cegcc*)
6070 # No point in relinking DLLs because paths are not encoded
6071 notinst_deplibs="$notinst_deplibs $lib"
6075 if test "$installed" = no; then
6076 notinst_deplibs="$notinst_deplibs $lib"
6081 # This is a shared library
6083 # Warn about portability, can't link against -module's on some
6084 # systems (darwin). Don't bleat about dlopened modules though!
6086 for dlpremoduletest in $dlprefiles; do
6087 if test "X$dlpremoduletest" = "X$lib"; then
6088 dlopenmodule="$dlpremoduletest"
6092 if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
6094 if test "$linkmode" = prog; then
6095 $ECHO "*** Warning: Linking the executable $output against the loadable module"
6097 $ECHO "*** Warning: Linking the shared library $output against the loadable module"
6099 $ECHO "*** $linklib is not portable!"
6101 if test "$linkmode" = lib &&
6102 test "$hardcode_into_libs" = yes; then
6103 # Hardcode the library path.
6104 # Skip directories that are in the system default run-time
6106 case " $sys_lib_dlsearch_path " in
6109 case "$compile_rpath " in
6111 *) compile_rpath="$compile_rpath $absdir"
6115 case " $sys_lib_dlsearch_path " in
6118 case "$finalize_rpath " in
6120 *) finalize_rpath="$finalize_rpath $libdir"
6126 if test -n "$old_archive_from_expsyms_cmds"; then
6127 # figure out the soname
6128 set dummy $library_names
6132 libname=`eval "\\$ECHO \"$libname_spec\""`
6133 # use dlname if we got it. it's perfectly good, no?
6134 if test -n "$dlname"; then
6136 elif test -n "$soname_spec"; then
6139 *cygwin* | mingw* | *cegcc*)
6140 func_arith $current - $age
6141 major=$func_arith_result
6145 eval soname=\"$soname_spec\"
6150 # Make a new name for the extract_expsyms_cmds to use
6152 func_basename "$soroot"
6153 soname="$func_basename_result"
6154 func_stripname 'lib' '.dll' "$soname"
6155 newlib=libimp-$func_stripname_result.a
6157 # If the library has no export list, then create one now
6158 if test -f "$output_objdir/$soname-def"; then :
6160 func_verbose "extracting exported symbol list from \`$soname'"
6161 func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
6165 if test -f "$output_objdir/$newlib"; then :; else
6166 func_verbose "generating import library for \`$soname'"
6167 func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
6169 # make sure the library variables are pointing to the new library
6172 fi # test -n "$old_archive_from_expsyms_cmds"
6174 if test "$linkmode" = prog || test "$mode" != relink; then
6179 case $hardcode_action in
6180 immediate | unsupported)
6181 if test "$hardcode_direct" = no; then
6184 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
6185 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
6186 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
6187 *-*-unixware7*) add_dir="-L$dir" ;;
6189 # if the lib is a (non-dlopened) module then we can not
6190 # link against it, someone is ignoring the earlier warnings
6191 if /usr/bin/file -L $add 2> /dev/null |
6192 $GREP ": [^:]* bundle" >/dev/null ; then
6193 if test "X$dlopenmodule" != "X$lib"; then
6194 $ECHO "*** Warning: lib $linklib is a module, not a shared library"
6195 if test -z "$old_library" ; then
6197 $ECHO "*** And there doesn't seem to be a static archive available"
6198 $ECHO "*** The link will probably fail, sorry"
6200 add="$dir/$old_library"
6202 elif test -n "$old_library"; then
6203 add="$dir/$old_library"
6207 elif test "$hardcode_minus_L" = no; then
6209 *-*-sunos*) add_shlibpath="$dir" ;;
6213 elif test "$hardcode_shlibpath_var" = no; then
6214 add_shlibpath="$dir"
6221 if test "$hardcode_direct" = yes &&
6222 test "$hardcode_direct_absolute" = no; then
6224 elif test "$hardcode_minus_L" = yes; then
6226 # Try looking first in the location we're being installed to.
6227 if test -n "$inst_prefix_dir"; then
6230 add_dir="$add_dir -L$inst_prefix_dir$libdir"
6235 elif test "$hardcode_shlibpath_var" = yes; then
6236 add_shlibpath="$dir"
6245 if test "$lib_linked" != yes; then
6246 func_fatal_configuration "unsupported hardcode properties"
6249 if test -n "$add_shlibpath"; then
6250 case :$compile_shlibpath: in
6251 *":$add_shlibpath:"*) ;;
6252 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
6255 if test "$linkmode" = prog; then
6256 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
6257 test -n "$add" && compile_deplibs="$add $compile_deplibs"
6259 test -n "$add_dir" && deplibs="$add_dir $deplibs"
6260 test -n "$add" && deplibs="$add $deplibs"
6261 if test "$hardcode_direct" != yes &&
6262 test "$hardcode_minus_L" != yes &&
6263 test "$hardcode_shlibpath_var" = yes; then
6264 case :$finalize_shlibpath: in
6266 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
6272 if test "$linkmode" = prog || test "$mode" = relink; then
6276 # Finalize command for both is simple: just hardcode it.
6277 if test "$hardcode_direct" = yes &&
6278 test "$hardcode_direct_absolute" = no; then
6279 add="$libdir/$linklib"
6280 elif test "$hardcode_minus_L" = yes; then
6283 elif test "$hardcode_shlibpath_var" = yes; then
6284 case :$finalize_shlibpath: in
6286 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
6289 elif test "$hardcode_automatic" = yes; then
6290 if test -n "$inst_prefix_dir" &&
6291 test -f "$inst_prefix_dir$libdir/$linklib" ; then
6292 add="$inst_prefix_dir$libdir/$linklib"
6294 add="$libdir/$linklib"
6297 # We cannot seem to hardcode it, guess we'll fake it.
6299 # Try looking first in the location we're being installed to.
6300 if test -n "$inst_prefix_dir"; then
6303 add_dir="$add_dir -L$inst_prefix_dir$libdir"
6310 if test "$linkmode" = prog; then
6311 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
6312 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
6314 test -n "$add_dir" && deplibs="$add_dir $deplibs"
6315 test -n "$add" && deplibs="$add $deplibs"
6318 elif test "$linkmode" = prog; then
6319 # Here we assume that one of hardcode_direct or hardcode_minus_L
6320 # is not unsupported. This is valid on all known static and
6322 if test "$hardcode_direct" != unsupported; then
6323 test -n "$old_library" && linklib="$old_library"
6324 compile_deplibs="$dir/$linklib $compile_deplibs"
6325 finalize_deplibs="$dir/$linklib $finalize_deplibs"
6327 compile_deplibs="-l$name -L$dir $compile_deplibs"
6328 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
6330 elif test "$build_libtool_libs" = yes; then
6331 # Not a shared library
6332 if test "$deplibs_check_method" != pass_all; then
6333 # We're trying link a shared library against a static one
6334 # but the system doesn't support it.
6336 # Just print a warning and add the library to dependency_libs so
6337 # that the program can be linked against the static library.
6339 $ECHO "*** Warning: This system can not link to static lib archive $lib."
6340 $ECHO "*** I have the capability to make that library automatically link in when"
6341 $ECHO "*** you link to this library. But I can only do this if you have a"
6342 $ECHO "*** shared version of the library, which you do not appear to have."
6343 if test "$module" = yes; then
6344 $ECHO "*** But as you try to build a module library, libtool will still create "
6345 $ECHO "*** a static module, that should work as long as the dlopening application"
6346 $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
6347 if test -z "$global_symbol_pipe"; then
6349 $ECHO "*** However, this would only work if libtool was able to extract symbol"
6350 $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
6351 $ECHO "*** not find such a program. So, this module is probably useless."
6352 $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
6354 if test "$build_old_libs" = no; then
6355 build_libtool_libs=module
6358 build_libtool_libs=no
6362 deplibs="$dir/$old_library $deplibs"
6365 fi # link shared/static library?
6367 if test "$linkmode" = lib; then
6368 if test -n "$dependency_libs" &&
6369 { test "$hardcode_into_libs" != yes ||
6370 test "$build_old_libs" = yes ||
6371 test "$link_static" = yes; }; then
6372 # Extract -R from dependency_libs
6374 for libdir in $dependency_libs; do
6376 -R*) func_stripname '-R' '' "$libdir"
6377 temp_xrpath=$func_stripname_result
6379 *" $temp_xrpath "*) ;;
6380 *) xrpath="$xrpath $temp_xrpath";;
6382 *) temp_deplibs="$temp_deplibs $libdir";;
6385 dependency_libs="$temp_deplibs"
6388 newlib_search_path="$newlib_search_path $absdir"
6389 # Link against this library
6390 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
6391 # ... and its dependency_libs
6393 for deplib in $dependency_libs; do
6394 newdependency_libs="$deplib $newdependency_libs"
6395 if $opt_duplicate_deps ; then
6396 case "$tmp_libs " in
6397 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
6400 tmp_libs="$tmp_libs $deplib"
6403 if test "$link_all_deplibs" != no; then
6404 # Add the search paths of all dependency libraries
6405 for deplib in $dependency_libs; do
6408 -L*) path="$deplib" ;;
6410 func_dirname "$deplib" "" "."
6411 dir="$func_dirname_result"
6412 # We need an absolute path.
6414 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
6416 absdir=`cd "$dir" && pwd`
6417 if test -z "$absdir"; then
6418 func_warning "cannot determine absolute directory name of \`$dir'"
6423 if $GREP "^installed=no" $deplib > /dev/null; then
6427 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
6428 if test -n "$deplibrary_names" ; then
6429 for tmp in $deplibrary_names ; do
6432 if test -f "$absdir/$objdir/$depdepl" ; then
6433 depdepl="$absdir/$objdir/$depdepl"
6434 darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
6435 if test -z "$darwin_install_name"; then
6436 darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
6438 compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
6439 linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
6445 path="-L$absdir/$objdir"
6449 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
6450 test -z "$libdir" && \
6451 func_fatal_error "\`$deplib' is not a valid libtool archive"
6452 test "$absdir" != "$libdir" && \
6453 func_warning "\`$deplib' seems to be moved"
6459 case " $deplibs " in
6461 *) deplibs="$path $deplibs" ;;
6464 fi # link_all_deplibs != no
6466 done # for deplib in $libs
6467 if test "$pass" = link; then
6468 if test "$linkmode" = "prog"; then
6469 compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
6470 finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
6472 compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
6475 dependency_libs="$newdependency_libs"
6476 if test "$pass" = dlpreopen; then
6477 # Link the dlpreopened libraries before other libraries
6478 for deplib in $save_deplibs; do
6479 deplibs="$deplib $deplibs"
6482 if test "$pass" != dlopen; then
6483 if test "$pass" != conv; then
6484 # Make sure lib_search_path contains only unique directories.
6486 for dir in $newlib_search_path; do
6487 case "$lib_search_path " in
6489 *) lib_search_path="$lib_search_path $dir" ;;
6495 if test "$linkmode,$pass" != "prog,link"; then
6498 vars="compile_deplibs finalize_deplibs"
6500 for var in $vars dependency_libs; do
6501 # Add libraries to $var in reverse order
6502 eval tmp_libs=\"\$$var\"
6504 for deplib in $tmp_libs; do
6505 # FIXME: Pedantically, this is the right thing to do, so
6506 # that some nasty dependency loop isn't accidentally
6508 #new_libs="$deplib $new_libs"
6509 # Pragmatically, this seems to cause very few problems in
6512 -L*) new_libs="$deplib $new_libs" ;;
6515 # And here is the reason: when a library appears more
6516 # than once as an explicit dependence of a library, or
6517 # is implicitly linked in more than once by the
6518 # compiler, it is considered special, and multiple
6519 # occurrences thereof are not removed. Compare this
6520 # with having the same library being listed as a
6521 # dependency of multiple other libraries: in this case,
6522 # we know (pedantically, we assume) the library does not
6523 # need to be listed more than once, so we keep only the
6524 # last copy. This is not always right, but it is rare
6525 # enough that we require users that really mean to play
6526 # such unportable linking tricks to link the library
6527 # using -Wl,-lname, so that libtool does not consider it
6528 # for duplicate removal.
6529 case " $specialdeplibs " in
6530 *" $deplib "*) new_libs="$deplib $new_libs" ;;
6532 case " $new_libs " in
6534 *) new_libs="$deplib $new_libs" ;;
6542 for deplib in $new_libs; do
6545 case " $tmp_libs " in
6547 *) tmp_libs="$tmp_libs $deplib" ;;
6550 *) tmp_libs="$tmp_libs $deplib" ;;
6553 eval $var=\"$tmp_libs\"
6556 # Last step: remove runtime libs from dependency_libs
6557 # (they stay in deplibs)
6559 for i in $dependency_libs ; do
6560 case " $predeps $postdeps $compiler_lib_search_path " in
6565 if test -n "$i" ; then
6566 tmp_libs="$tmp_libs $i"
6569 dependency_libs=$tmp_libs
6571 if test "$linkmode" = prog; then
6572 dlfiles="$newdlfiles"
6574 if test "$linkmode" = prog || test "$linkmode" = lib; then
6575 dlprefiles="$newdlprefiles"
6580 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
6581 func_warning "\`-dlopen' is ignored for archives"
6586 func_warning "\`-l' and \`-L' are ignored for archives" ;;
6589 test -n "$rpath" && \
6590 func_warning "\`-rpath' is ignored for archives"
6592 test -n "$xrpath" && \
6593 func_warning "\`-R' is ignored for archives"
6595 test -n "$vinfo" && \
6596 func_warning "\`-version-info/-version-number' is ignored for archives"
6598 test -n "$release" && \
6599 func_warning "\`-release' is ignored for archives"
6601 test -n "$export_symbols$export_symbols_regex" && \
6602 func_warning "\`-export-symbols' is ignored for archives"
6604 # Now set the variables for building old libraries.
6605 build_libtool_libs=no
6607 objs="$objs$old_deplibs"
6611 # Make sure we only generate libraries of the form `libNAME.la'.
6614 func_stripname 'lib' '.la' "$outputname"
6615 name=$func_stripname_result
6616 eval shared_ext=\"$shrext_cmds\"
6617 eval libname=\"$libname_spec\"
6620 test "$module" = no && \
6621 func_fatal_help "libtool library \`$output' must begin with \`lib'"
6623 if test "$need_lib_prefix" != no; then
6624 # Add the "lib" prefix for modules if required
6625 func_stripname '' '.la' "$outputname"
6626 name=$func_stripname_result
6627 eval shared_ext=\"$shrext_cmds\"
6628 eval libname=\"$libname_spec\"
6630 func_stripname '' '.la' "$outputname"
6631 libname=$func_stripname_result
6636 if test -n "$objs"; then
6637 if test "$deplibs_check_method" != pass_all; then
6638 func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
6641 $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
6642 $ECHO "*** objects $objs is not portable!"
6643 libobjs="$libobjs $objs"
6647 test "$dlself" != no && \
6648 func_warning "\`-dlopen self' is ignored for libtool libraries"
6652 test "$#" -gt 1 && \
6653 func_warning "ignoring multiple \`-rpath's for a libtool library"
6658 if test -z "$rpath"; then
6659 if test "$build_libtool_libs" = yes; then
6660 # Building a libtool convenience library.
6661 # Some compilers have problems with a `.al' extension so
6662 # convenience libraries should have the same extension an
6663 # archive normally would.
6664 oldlibs="$output_objdir/$libname.$libext $oldlibs"
6665 build_libtool_libs=convenience
6669 test -n "$vinfo" && \
6670 func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
6672 test -n "$release" && \
6673 func_warning "\`-release' is ignored for convenience libraries"
6676 # Parse the version information argument.
6677 save_ifs="$IFS"; IFS=':'
6678 set dummy $vinfo 0 0 0
6683 func_fatal_help "too many parameters to \`-version-info'"
6685 # convert absolute version numbers to libtool ages
6686 # this retains compatibility with .la files and attempts
6687 # to make the code below a bit more comprehensible
6689 case $vinfo_number in
6693 number_revision="$3"
6695 # There are really only two kinds -- those that
6696 # use the current revision as the major version
6697 # and those that subtract age and use age as
6698 # a minor version. But, then there is irix
6699 # which has an extra 1 added just for fun
6701 case $version_type in
6702 darwin|linux|osf|windows|none)
6703 func_arith $number_major + $number_minor
6704 current=$func_arith_result
6706 revision="$number_revision"
6708 freebsd-aout|freebsd-elf|sunos)
6709 current="$number_major"
6710 revision="$number_minor"
6714 func_arith $number_major + $number_minor
6715 current=$func_arith_result
6717 revision="$number_minor"
6718 lt_irix_increment=no
6721 func_fatal_configuration "$modename: unknown library version type \`$version_type'"
6732 # Check that each of the things are valid numbers.
6734 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]) ;;
6736 func_error "CURRENT \`$current' must be a nonnegative integer"
6737 func_fatal_error "\`$vinfo' is not valid version information"
6742 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]) ;;
6744 func_error "REVISION \`$revision' must be a nonnegative integer"
6745 func_fatal_error "\`$vinfo' is not valid version information"
6750 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]) ;;
6752 func_error "AGE \`$age' must be a nonnegative integer"
6753 func_fatal_error "\`$vinfo' is not valid version information"
6757 if test "$age" -gt "$current"; then
6758 func_error "AGE \`$age' is greater than the current interface number \`$current'"
6759 func_fatal_error "\`$vinfo' is not valid version information"
6762 # Calculate the version variables.
6766 case $version_type in
6770 # Like Linux, but with the current version available in
6771 # verstring for coding it into the library header
6772 func_arith $current - $age
6773 major=.$func_arith_result
6774 versuffix="$major.$age.$revision"
6775 # Darwin ld doesn't like 0 for these options...
6776 func_arith $current + 1
6777 minor_current=$func_arith_result
6778 xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
6779 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
6784 versuffix=".$current.$revision";
6789 versuffix=".$current"
6793 if test "X$lt_irix_increment" = "Xno"; then
6794 func_arith $current - $age
6796 func_arith $current - $age + 1
6798 major=$func_arith_result
6800 case $version_type in
6801 nonstopux) verstring_prefix=nonstopux ;;
6802 *) verstring_prefix=sgi ;;
6804 verstring="$verstring_prefix$major.$revision"
6806 # Add in all the interfaces that we are compatible with.
6808 while test "$loop" -ne 0; do
6809 func_arith $revision - $loop
6810 iface=$func_arith_result
6811 func_arith $loop - 1
6812 loop=$func_arith_result
6813 verstring="$verstring_prefix$major.$iface:$verstring"
6816 # Before this point, $major must not contain `.'.
6818 versuffix="$major.$revision"
6822 func_arith $current - $age
6823 major=.$func_arith_result
6824 versuffix="$major.$age.$revision"
6828 func_arith $current - $age
6829 major=.$func_arith_result
6830 versuffix=".$current.$age.$revision"
6831 verstring="$current.$age.$revision"
6833 # Add in all the interfaces that we are compatible with.
6835 while test "$loop" -ne 0; do
6836 func_arith $current - $loop
6837 iface=$func_arith_result
6838 func_arith $loop - 1
6839 loop=$func_arith_result
6840 verstring="$verstring:${iface}.0"
6843 # Make executables depend on our current version.
6844 verstring="$verstring:${current}.0"
6849 versuffix=".$current"
6854 versuffix=".$current.$revision"
6858 # Use '-' rather than '.', since we only want one
6859 # extension on DOS 8.3 filesystems.
6860 func_arith $current - $age
6861 major=$func_arith_result
6866 func_fatal_configuration "unknown library version type \`$version_type'"
6870 # Clear the version info if we defaulted, and they specified a release.
6871 if test -z "$vinfo" && test -n "$release"; then
6873 case $version_type in
6875 # we can't check for "0.0" in archive_cmds due to quoting
6876 # problems, so we reset it completely
6883 if test "$need_version" = no; then
6890 # Remove version info from name if versioning should be avoided
6891 if test "$avoid_version" = yes && test "$need_version" = no; then
6897 # Check to see if the archive will have undefined symbols.
6898 if test "$allow_undefined" = yes; then
6899 if test "$allow_undefined_flag" = unsupported; then
6900 func_warning "undefined symbols not allowed in $host shared libraries"
6901 build_libtool_libs=no
6905 # Don't allow undefined symbols.
6906 allow_undefined_flag="$no_undefined_flag"
6911 func_generate_dlsyms "$libname" "$libname" "yes"
6912 libobjs="$libobjs $symfileobj"
6913 test "X$libobjs" = "X " && libobjs=
6915 if test "$mode" != relink; then
6916 # Remove our outputs, but don't remove object files since they
6917 # may have been created when compiling PIC objects.
6919 tempremovelist=`$ECHO "$output_objdir/*"`
6920 for p in $tempremovelist; do
6924 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
6925 if test "X$precious_files_regex" != "X"; then
6926 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
6931 removelist="$removelist $p"
6936 test -n "$removelist" && \
6937 func_show_eval "${RM}r \$removelist"
6940 # Now set the variables for building old libraries.
6941 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
6942 oldlibs="$oldlibs $output_objdir/$libname.$libext"
6944 # Transform .lo files to .o files.
6945 oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
6948 # Eliminate all temporary directories.
6949 #for path in $notinst_path; do
6950 # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
6951 # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
6952 # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
6955 if test -n "$xrpath"; then
6956 # If the user specified any rpath flags, then add them.
6958 for libdir in $xrpath; do
6959 temp_xrpath="$temp_xrpath -R$libdir"
6960 case "$finalize_rpath " in
6962 *) finalize_rpath="$finalize_rpath $libdir" ;;
6965 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
6966 dependency_libs="$temp_xrpath $dependency_libs"
6970 # Make sure dlfiles contains only unique files that won't be dlpreopened
6971 old_dlfiles="$dlfiles"
6973 for lib in $old_dlfiles; do
6974 case " $dlprefiles $dlfiles " in
6976 *) dlfiles="$dlfiles $lib" ;;
6980 # Make sure dlprefiles contains only unique files
6981 old_dlprefiles="$dlprefiles"
6983 for lib in $old_dlprefiles; do
6984 case "$dlprefiles " in
6986 *) dlprefiles="$dlprefiles $lib" ;;
6990 if test "$build_libtool_libs" = yes; then
6991 if test -n "$rpath"; then
6993 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
6994 # these systems don't actually have a c library (as such)!
6996 *-*-rhapsody* | *-*-darwin1.[012])
6997 # Rhapsody C library is in the System framework
6998 deplibs="$deplibs System.ltframework"
7001 # Don't link with libc until the a.out ld.so is fixed.
7003 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
7004 # Do not include libc due to us having libc/libc_r.
7006 *-*-sco3.2v5* | *-*-sco5v6*)
7007 # Causes problems with __ctype
7009 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
7010 # Compiler inserts libc in the correct place for threads to work
7013 # Add libc to deplibs on all other systems if necessary.
7014 if test "$build_libtool_need_lc" = "yes"; then
7015 deplibs="$deplibs -lc"
7021 # Transform deplibs into only deplibs that can be linked in shared.
7023 libname_save=$libname
7024 release_save=$release
7025 versuffix_save=$versuffix
7027 # I'm not sure if I'm treating the release correctly. I think
7028 # release should show up in the -l (ie -lgmp5) so we don't want to
7029 # add it in twice. Is that correct?
7035 case $deplibs_check_method in
7037 # Don't check for shared/static. Everything works.
7038 # This might be a little naive. We might want to check
7039 # whether the library exists or not. But this is on
7040 # osf3 & osf4 and I'm not really sure... Just
7041 # implementing what was already the behavior.
7045 # This code stresses the "libraries are programs" paradigm to its
7046 # limits. Maybe even breaks it. We compile a program, linking it
7047 # against the deplibs as a proxy for the library. Then we can check
7048 # whether they linked in statically or dynamically with ldd.
7049 $opt_dry_run || $RM conftest.c
7050 cat > conftest.c <<EOF
7051 int main() { return 0; }
7053 $opt_dry_run || $RM conftest
7054 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
7055 ldd_output=`ldd conftest`
7056 for i in $deplibs; do
7059 func_stripname -l '' "$i"
7060 name=$func_stripname_result
7061 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7062 case " $predeps $postdeps " in
7064 newdeplibs="$newdeplibs $i"
7069 if test -n "$i" ; then
7070 libname=`eval "\\$ECHO \"$libname_spec\""`
7071 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
7072 set dummy $deplib_matches; shift
7074 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
7075 newdeplibs="$newdeplibs $i"
7079 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
7080 $ECHO "*** I have the capability to make that library automatically link in when"
7081 $ECHO "*** you link to this library. But I can only do this if you have a"
7082 $ECHO "*** shared version of the library, which I believe you do not have"
7083 $ECHO "*** because a test_compile did reveal that the linker did not use it for"
7084 $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
7089 newdeplibs="$newdeplibs $i"
7094 # Error occurred in the first compile. Let's try to salvage
7095 # the situation: Compile a separate program for each library.
7096 for i in $deplibs; do
7099 func_stripname -l '' "$i"
7100 name=$func_stripname_result
7101 $opt_dry_run || $RM conftest
7102 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
7103 ldd_output=`ldd conftest`
7104 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7105 case " $predeps $postdeps " in
7107 newdeplibs="$newdeplibs $i"
7112 if test -n "$i" ; then
7113 libname=`eval "\\$ECHO \"$libname_spec\""`
7114 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
7115 set dummy $deplib_matches; shift
7117 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
7118 newdeplibs="$newdeplibs $i"
7122 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
7123 $ECHO "*** I have the capability to make that library automatically link in when"
7124 $ECHO "*** you link to this library. But I can only do this if you have a"
7125 $ECHO "*** shared version of the library, which you do not appear to have"
7126 $ECHO "*** because a test_compile did reveal that the linker did not use this one"
7127 $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
7133 $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
7134 $ECHO "*** make it link in! You will probably need to install it or some"
7135 $ECHO "*** library that it depends on before this library will be fully"
7136 $ECHO "*** functional. Installing it before continuing would be even better."
7140 newdeplibs="$newdeplibs $i"
7147 set dummy $deplibs_check_method; shift
7148 file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
7149 for a_deplib in $deplibs; do
7152 func_stripname -l '' "$a_deplib"
7153 name=$func_stripname_result
7154 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7155 case " $predeps $postdeps " in
7157 newdeplibs="$newdeplibs $a_deplib"
7162 if test -n "$a_deplib" ; then
7163 libname=`eval "\\$ECHO \"$libname_spec\""`
7164 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
7165 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
7166 for potent_lib in $potential_libs; do
7167 # Follow soft links.
7168 if ls -lLd "$potent_lib" 2>/dev/null |
7169 $GREP " -> " >/dev/null; then
7172 # The statement above tries to avoid entering an
7173 # endless loop below, in case of cyclic links.
7174 # We might still enter an endless loop, since a link
7175 # loop can be closed while we follow links,
7177 potlib="$potent_lib"
7178 while test -h "$potlib" 2>/dev/null; do
7179 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
7181 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
7182 *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
7185 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
7187 $EGREP "$file_magic_regex" > /dev/null; then
7188 newdeplibs="$newdeplibs $a_deplib"
7195 if test -n "$a_deplib" ; then
7198 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
7199 $ECHO "*** I have the capability to make that library automatically link in when"
7200 $ECHO "*** you link to this library. But I can only do this if you have a"
7201 $ECHO "*** shared version of the library, which you do not appear to have"
7202 $ECHO "*** because I did check the linker path looking for a file starting"
7203 if test -z "$potlib" ; then
7204 $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
7206 $ECHO "*** with $libname and none of the candidates passed a file format test"
7207 $ECHO "*** using a file magic. Last file checked: $potlib"
7212 # Add a -L argument.
7213 newdeplibs="$newdeplibs $a_deplib"
7216 done # Gone through all deplibs.
7219 set dummy $deplibs_check_method; shift
7220 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
7221 for a_deplib in $deplibs; do
7224 func_stripname -l '' "$a_deplib"
7225 name=$func_stripname_result
7226 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7227 case " $predeps $postdeps " in
7229 newdeplibs="$newdeplibs $a_deplib"
7234 if test -n "$a_deplib" ; then
7235 libname=`eval "\\$ECHO \"$libname_spec\""`
7236 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
7237 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
7238 for potent_lib in $potential_libs; do
7239 potlib="$potent_lib" # see symlink-check above in file_magic test
7240 if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
7241 $EGREP "$match_pattern_regex" > /dev/null; then
7242 newdeplibs="$newdeplibs $a_deplib"
7249 if test -n "$a_deplib" ; then
7252 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
7253 $ECHO "*** I have the capability to make that library automatically link in when"
7254 $ECHO "*** you link to this library. But I can only do this if you have a"
7255 $ECHO "*** shared version of the library, which you do not appear to have"
7256 $ECHO "*** because I did check the linker path looking for a file starting"
7257 if test -z "$potlib" ; then
7258 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
7260 $ECHO "*** with $libname and none of the candidates passed a file format test"
7261 $ECHO "*** using a regex pattern. Last file checked: $potlib"
7266 # Add a -L argument.
7267 newdeplibs="$newdeplibs $a_deplib"
7270 done # Gone through all deplibs.
7274 tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
7275 -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
7276 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7277 for i in $predeps $postdeps ; do
7278 # can't use Xsed below, because $i might contain '/'
7279 tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
7282 if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' |
7283 $GREP . >/dev/null; then
7285 if test "X$deplibs_check_method" = "Xnone"; then
7286 $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
7288 $ECHO "*** Warning: inter-library dependencies are not known to be supported."
7290 $ECHO "*** All declared inter-library dependencies are being dropped."
7295 versuffix=$versuffix_save
7297 release=$release_save
7298 libname=$libname_save
7302 *-*-rhapsody* | *-*-darwin1.[012])
7303 # On Rhapsody replace the C library with the System framework
7304 newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
7308 if test "$droppeddeps" = yes; then
7309 if test "$module" = yes; then
7311 $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
7312 $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
7313 $ECHO "*** a static module, that should work as long as the dlopening"
7314 $ECHO "*** application is linked with the -dlopen flag."
7315 if test -z "$global_symbol_pipe"; then
7317 $ECHO "*** However, this would only work if libtool was able to extract symbol"
7318 $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
7319 $ECHO "*** not find such a program. So, this module is probably useless."
7320 $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
7322 if test "$build_old_libs" = no; then
7323 oldlibs="$output_objdir/$libname.$libext"
7324 build_libtool_libs=module
7327 build_libtool_libs=no
7330 $ECHO "*** The inter-library dependencies that have been dropped here will be"
7331 $ECHO "*** automatically added whenever a program is linked with this library"
7332 $ECHO "*** or is declared to -dlopen it."
7334 if test "$allow_undefined" = no; then
7336 $ECHO "*** Since this library must not contain undefined symbols,"
7337 $ECHO "*** because either the platform does not support them or"
7338 $ECHO "*** it was explicitly requested with -no-undefined,"
7339 $ECHO "*** libtool will only create a static version of it."
7340 if test "$build_old_libs" = no; then
7341 oldlibs="$output_objdir/$libname.$libext"
7342 build_libtool_libs=module
7345 build_libtool_libs=no
7350 # Done checking deplibs!
7353 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
7356 newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
7357 new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
7358 deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
7362 # move library search paths that coincide with paths to not yet
7363 # installed libraries to the beginning of the library search list
7365 for path in $notinst_path; do
7366 case " $new_libs " in
7367 *" -L$path/$objdir "*) ;;
7369 case " $deplibs " in
7370 *" -L$path/$objdir "*)
7371 new_libs="$new_libs -L$path/$objdir" ;;
7376 for deplib in $deplibs; do
7379 case " $new_libs " in
7381 *) new_libs="$new_libs $deplib" ;;
7384 *) new_libs="$new_libs $deplib" ;;
7389 # All the library-specific variables (install_libdir is set above).
7394 # Test again, we may have decided not to build it any more
7395 if test "$build_libtool_libs" = yes; then
7396 if test "$hardcode_into_libs" = yes; then
7397 # Hardcode the library paths
7400 rpath="$finalize_rpath"
7401 test "$mode" != relink && rpath="$compile_rpath$rpath"
7402 for libdir in $rpath; do
7403 if test -n "$hardcode_libdir_flag_spec"; then
7404 if test -n "$hardcode_libdir_separator"; then
7405 if test -z "$hardcode_libdirs"; then
7406 hardcode_libdirs="$libdir"
7408 # Just accumulate the unique libdirs.
7409 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
7410 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
7413 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
7418 eval flag=\"$hardcode_libdir_flag_spec\"
7419 dep_rpath="$dep_rpath $flag"
7421 elif test -n "$runpath_var"; then
7422 case "$perm_rpath " in
7424 *) perm_rpath="$perm_rpath $libdir" ;;
7428 # Substitute the hardcoded libdirs into the rpath.
7429 if test -n "$hardcode_libdir_separator" &&
7430 test -n "$hardcode_libdirs"; then
7431 libdir="$hardcode_libdirs"
7432 if test -n "$hardcode_libdir_flag_spec_ld"; then
7433 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
7435 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
7438 if test -n "$runpath_var" && test -n "$perm_rpath"; then
7439 # We should set the runpath_var.
7441 for dir in $perm_rpath; do
7444 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
7446 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
7449 shlibpath="$finalize_shlibpath"
7450 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
7451 if test -n "$shlibpath"; then
7452 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
7455 # Get the real and link names of the library.
7456 eval shared_ext=\"$shrext_cmds\"
7457 eval library_names=\"$library_names_spec\"
7458 set dummy $library_names
7463 if test -n "$soname_spec"; then
7464 eval soname=\"$soname_spec\"
7468 if test -z "$dlname"; then
7472 lib="$output_objdir/$realname"
7476 linknames="$linknames $link"
7479 # Use standard objects if they are pic
7480 test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
7481 test "X$libobjs" = "X " && libobjs=
7484 if test -n "$export_symbols" && test -n "$include_expsyms"; then
7485 $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
7486 export_symbols="$output_objdir/$libname.uexp"
7487 delfiles="$delfiles $export_symbols"
7490 orig_export_symbols=
7492 cygwin* | mingw* | cegcc*)
7493 if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
7494 # exporting using user supplied symfile
7495 if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
7496 # and it's NOT already a .def file. Must figure out
7497 # which of the given symbols are data symbols and tag
7498 # them as such. So, trigger use of export_symbols_cmds.
7499 # export_symbols gets reassigned inside the "prepare
7500 # the list of exported symbols" if statement, so the
7501 # include_expsyms logic still works.
7502 orig_export_symbols="$export_symbols"
7504 always_export_symbols=yes
7510 # Prepare the list of exported symbols
7511 if test -z "$export_symbols"; then
7512 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
7513 func_verbose "generating symbol list for \`$libname.la'"
7514 export_symbols="$output_objdir/$libname.exp"
7515 $opt_dry_run || $RM $export_symbols
7516 cmds=$export_symbols_cmds
7517 save_ifs="$IFS"; IFS='~'
7518 for cmd in $cmds; do
7522 len=$func_len_result
7523 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7524 func_show_eval "$cmd" 'exit $?'
7525 skipped_export=false
7527 # The command line is too long to execute in one step.
7528 func_verbose "using reloadable object file for export list..."
7530 # Break out early, otherwise skipped_export may be
7531 # set to false by a later but shorter cmd.
7536 if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
7537 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
7538 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
7543 if test -n "$export_symbols" && test -n "$include_expsyms"; then
7544 tmp_export_symbols="$export_symbols"
7545 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
7546 $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
7549 if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
7550 # The given exports_symbols file has to be filtered, so filter it.
7551 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
7552 # FIXME: $output_objdir/$libname.filter potentially contains lots of
7553 # 's' commands which not all seds can handle. GNU sed should be fine
7554 # though. Also, the filter scales superlinearly with the number of
7555 # global variables. join(1) would be nice here, but unfortunately
7556 # isn't a blessed tool.
7557 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
7558 delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
7559 export_symbols=$output_objdir/$libname.def
7560 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
7564 for test_deplib in $deplibs; do
7565 case " $convenience " in
7566 *" $test_deplib "*) ;;
7568 tmp_deplibs="$tmp_deplibs $test_deplib"
7572 deplibs="$tmp_deplibs"
7574 if test -n "$convenience"; then
7575 if test -n "$whole_archive_flag_spec" &&
7576 test "$compiler_needs_object" = yes &&
7577 test -z "$libobjs"; then
7578 # extract the archives, so we have objects to list.
7579 # TODO: could optimize this to just extract one archive.
7580 whole_archive_flag_spec=
7582 if test -n "$whole_archive_flag_spec"; then
7583 save_libobjs=$libobjs
7584 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
7585 test "X$libobjs" = "X " && libobjs=
7587 gentop="$output_objdir/${outputname}x"
7588 generated="$generated $gentop"
7590 func_extract_archives $gentop $convenience
7591 libobjs="$libobjs $func_extract_archives_result"
7592 test "X$libobjs" = "X " && libobjs=
7596 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
7597 eval flag=\"$thread_safe_flag_spec\"
7598 linker_flags="$linker_flags $flag"
7601 # Make a backup of the uninstalled library when relinking
7602 if test "$mode" = relink; then
7603 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
7606 # Do each of the archive commands.
7607 if test "$module" = yes && test -n "$module_cmds" ; then
7608 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
7609 eval test_cmds=\"$module_expsym_cmds\"
7610 cmds=$module_expsym_cmds
7612 eval test_cmds=\"$module_cmds\"
7616 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
7617 eval test_cmds=\"$archive_expsym_cmds\"
7618 cmds=$archive_expsym_cmds
7620 eval test_cmds=\"$archive_cmds\"
7625 if test "X$skipped_export" != "X:" &&
7626 func_len " $test_cmds" &&
7627 len=$func_len_result &&
7628 test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7631 # The command line is too long to link in one step, link piecewise
7632 # or, if using GNU ld and skipped_export is not :, use a linker
7635 # Save the value of $output and $libobjs because we want to
7636 # use them later. If we have whole_archive_flag_spec, we
7637 # want to use save_libobjs as it was before
7638 # whole_archive_flag_spec was expanded, because we can't
7639 # assume the linker understands whole_archive_flag_spec.
7640 # This may have to be revisited, in case too many
7641 # convenience libraries get linked in and end up exceeding
7643 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
7644 save_libobjs=$libobjs
7647 output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
7649 # Clear the reloadable object creation command queue and
7650 # initialize k to one.
7657 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
7658 output=${output_objdir}/${output_la}.lnkscript
7659 func_verbose "creating GNU ld script: $output"
7660 $ECHO 'INPUT (' > $output
7661 for obj in $save_libobjs
7663 $ECHO "$obj" >> $output
7665 $ECHO ')' >> $output
7666 delfiles="$delfiles $output"
7667 elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
7668 output=${output_objdir}/${output_la}.lnk
7669 func_verbose "creating linker input file list: $output"
7674 if test "$compiler_needs_object" = yes; then
7680 $ECHO "$obj" >> $output
7682 delfiles="$delfiles $output"
7683 output=$firstobj\"$file_list_spec$output\"
7685 if test -n "$save_libobjs"; then
7686 func_verbose "creating reloadable object files..."
7687 output=$output_objdir/$output_la-${k}.$objext
7688 eval test_cmds=\"$reload_cmds\"
7689 func_len " $test_cmds"
7690 len0=$func_len_result
7693 # Loop over the list of objects to be linked.
7694 for obj in $save_libobjs
7697 func_arith $len + $func_len_result
7698 len=$func_arith_result
7699 if test "X$objlist" = X ||
7700 test "$len" -lt "$max_cmd_len"; then
7701 func_append objlist " $obj"
7703 # The command $test_cmds is almost too long, add a
7704 # command to the queue.
7705 if test "$k" -eq 1 ; then
7706 # The first file doesn't have a previous command to add.
7707 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
7709 # All subsequent reloadable object files will link in
7710 # the last one created.
7711 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
7713 last_robj=$output_objdir/$output_la-${k}.$objext
7715 k=$func_arith_result
7716 output=$output_objdir/$output_la-${k}.$objext
7718 func_len " $last_robj"
7719 func_arith $len0 + $func_len_result
7720 len=$func_arith_result
7723 # Handle the remaining objects by creating one last
7724 # reloadable object file. All subsequent reloadable object
7725 # files will link in the last one created.
7726 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
7727 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
7728 if test -n "$last_robj"; then
7729 eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
7731 delfiles="$delfiles $output"
7737 if ${skipped_export-false}; then
7738 func_verbose "generating symbol list for \`$libname.la'"
7739 export_symbols="$output_objdir/$libname.exp"
7740 $opt_dry_run || $RM $export_symbols
7742 # Append the command to create the export file.
7743 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
7744 eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
7745 if test -n "$last_robj"; then
7746 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
7750 test -n "$save_libobjs" &&
7751 func_verbose "creating a temporary reloadable object file: $output"
7753 # Loop through the commands generated above and execute them.
7754 save_ifs="$IFS"; IFS='~'
7755 for cmd in $concat_cmds; do
7758 func_quote_for_expand "$cmd"
7759 eval "func_echo $func_quote_for_expand_result"
7761 $opt_dry_run || eval "$cmd" || {
7764 # Restore the uninstalled library and exit
7765 if test "$mode" = relink; then
7766 ( cd "$output_objdir" && \
7767 $RM "${realname}T" && \
7768 $MV "${realname}U" "$realname" )
7776 if test -n "$export_symbols_regex" && ${skipped_export-false}; then
7777 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
7778 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
7782 if ${skipped_export-false}; then
7783 if test -n "$export_symbols" && test -n "$include_expsyms"; then
7784 tmp_export_symbols="$export_symbols"
7785 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
7786 $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
7789 if test -n "$orig_export_symbols"; then
7790 # The given exports_symbols file has to be filtered, so filter it.
7791 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
7792 # FIXME: $output_objdir/$libname.filter potentially contains lots of
7793 # 's' commands which not all seds can handle. GNU sed should be fine
7794 # though. Also, the filter scales superlinearly with the number of
7795 # global variables. join(1) would be nice here, but unfortunately
7796 # isn't a blessed tool.
7797 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
7798 delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
7799 export_symbols=$output_objdir/$libname.def
7800 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
7805 # Restore the value of output.
7808 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
7809 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
7810 test "X$libobjs" = "X " && libobjs=
7812 # Expand the library linking commands again to reset the
7813 # value of $libobjs for piecewise linking.
7815 # Do each of the archive commands.
7816 if test "$module" = yes && test -n "$module_cmds" ; then
7817 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
7818 cmds=$module_expsym_cmds
7823 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
7824 cmds=$archive_expsym_cmds
7831 if test -n "$delfiles"; then
7832 # Append the command to remove temporary files to $cmds.
7833 eval cmds=\"\$cmds~\$RM $delfiles\"
7836 # Add any objects from preloaded convenience libraries
7837 if test -n "$dlprefiles"; then
7838 gentop="$output_objdir/${outputname}x"
7839 generated="$generated $gentop"
7841 func_extract_archives $gentop $dlprefiles
7842 libobjs="$libobjs $func_extract_archives_result"
7843 test "X$libobjs" = "X " && libobjs=
7846 save_ifs="$IFS"; IFS='~'
7847 for cmd in $cmds; do
7851 func_quote_for_expand "$cmd"
7852 eval "func_echo $func_quote_for_expand_result"
7854 $opt_dry_run || eval "$cmd" || {
7857 # Restore the uninstalled library and exit
7858 if test "$mode" = relink; then
7859 ( cd "$output_objdir" && \
7860 $RM "${realname}T" && \
7861 $MV "${realname}U" "$realname" )
7869 # Restore the uninstalled library and exit
7870 if test "$mode" = relink; then
7871 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
7873 if test -n "$convenience"; then
7874 if test -z "$whole_archive_flag_spec"; then
7875 func_show_eval '${RM}r "$gentop"'
7882 # Create links to the real library.
7883 for linkname in $linknames; do
7884 if test "$realname" != "$linkname"; then
7885 func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
7889 # If -module or -export-dynamic was specified, set the dlname.
7890 if test "$module" = yes || test "$export_dynamic" = yes; then
7891 # On all known operating systems, these are identical.
7898 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
7899 func_warning "\`-dlopen' is ignored for objects"
7904 func_warning "\`-l' and \`-L' are ignored for objects" ;;
7907 test -n "$rpath" && \
7908 func_warning "\`-rpath' is ignored for objects"
7910 test -n "$xrpath" && \
7911 func_warning "\`-R' is ignored for objects"
7913 test -n "$vinfo" && \
7914 func_warning "\`-version-info' is ignored for objects"
7916 test -n "$release" && \
7917 func_warning "\`-release' is ignored for objects"
7921 test -n "$objs$old_deplibs" && \
7922 func_fatal_error "cannot build library object \`$output' from non-libtool objects"
7926 obj=$func_lo2o_result
7934 # Delete the old objects.
7935 $opt_dry_run || $RM $obj $libobj
7937 # Objects from convenience libraries. This assumes
7938 # single-version convenience libraries. Whenever we create
7939 # different ones for PIC/non-PIC, this we'll have to duplicate
7943 # reload_cmds runs $LD directly, so let us get rid of
7944 # -Wl from whole_archive_flag_spec and hope we can get by with
7945 # turning comma into space..
7948 if test -n "$convenience"; then
7949 if test -n "$whole_archive_flag_spec"; then
7950 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
7951 reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
7953 gentop="$output_objdir/${obj}x"
7954 generated="$generated $gentop"
7956 func_extract_archives $gentop $convenience
7957 reload_conv_objs="$reload_objs $func_extract_archives_result"
7961 # Create the old-style object.
7962 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
7965 func_execute_cmds "$reload_cmds" 'exit $?'
7967 # Exit if we aren't doing a library object file.
7968 if test -z "$libobj"; then
7969 if test -n "$gentop"; then
7970 func_show_eval '${RM}r "$gentop"'
7976 if test "$build_libtool_libs" != yes; then
7977 if test -n "$gentop"; then
7978 func_show_eval '${RM}r "$gentop"'
7981 # Create an invalid libtool object if no PIC, so that we don't
7982 # accidentally link it into a program.
7983 # $show "echo timestamp > $libobj"
7984 # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
7988 if test -n "$pic_flag" || test "$pic_mode" != default; then
7989 # Only do commands if we really have different PIC objects.
7990 reload_objs="$libobjs $reload_conv_objs"
7992 func_execute_cmds "$reload_cmds" 'exit $?'
7995 if test -n "$gentop"; then
7996 func_show_eval '${RM}r "$gentop"'
8004 *cygwin*) func_stripname '' '.exe' "$output"
8005 output=$func_stripname_result.exe;;
8007 test -n "$vinfo" && \
8008 func_warning "\`-version-info' is ignored for programs"
8010 test -n "$release" && \
8011 func_warning "\`-release' is ignored for programs"
8013 test "$preload" = yes \
8014 && test "$dlopen_support" = unknown \
8015 && test "$dlopen_self" = unknown \
8016 && test "$dlopen_self_static" = unknown && \
8017 func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
8020 *-*-rhapsody* | *-*-darwin1.[012])
8021 # On Rhapsody replace the C library is the System framework
8022 compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
8023 finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
8029 # Don't allow lazy linking, it breaks C++ global constructors
8030 # But is supposedly fixed on 10.4 or later (yay!).
8031 if test "$tagname" = CXX ; then
8032 case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
8034 compile_command="$compile_command ${wl}-bind_at_load"
8035 finalize_command="$finalize_command ${wl}-bind_at_load"
8039 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
8040 compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
8041 finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
8046 # move library search paths that coincide with paths to not yet
8047 # installed libraries to the beginning of the library search list
8049 for path in $notinst_path; do
8050 case " $new_libs " in
8051 *" -L$path/$objdir "*) ;;
8053 case " $compile_deplibs " in
8054 *" -L$path/$objdir "*)
8055 new_libs="$new_libs -L$path/$objdir" ;;
8060 for deplib in $compile_deplibs; do
8063 case " $new_libs " in
8065 *) new_libs="$new_libs $deplib" ;;
8068 *) new_libs="$new_libs $deplib" ;;
8071 compile_deplibs="$new_libs"
8074 compile_command="$compile_command $compile_deplibs"
8075 finalize_command="$finalize_command $finalize_deplibs"
8077 if test -n "$rpath$xrpath"; then
8078 # If the user specified any rpath flags, then add them.
8079 for libdir in $rpath $xrpath; do
8080 # This is the magic to use -rpath.
8081 case "$finalize_rpath " in
8083 *) finalize_rpath="$finalize_rpath $libdir" ;;
8088 # Now hardcode the library paths
8091 for libdir in $compile_rpath $finalize_rpath; do
8092 if test -n "$hardcode_libdir_flag_spec"; then
8093 if test -n "$hardcode_libdir_separator"; then
8094 if test -z "$hardcode_libdirs"; then
8095 hardcode_libdirs="$libdir"
8097 # Just accumulate the unique libdirs.
8098 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
8099 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8102 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
8107 eval flag=\"$hardcode_libdir_flag_spec\"
8108 rpath="$rpath $flag"
8110 elif test -n "$runpath_var"; then
8111 case "$perm_rpath " in
8113 *) perm_rpath="$perm_rpath $libdir" ;;
8117 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
8118 testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
8119 case :$dllsearchpath: in
8121 ::) dllsearchpath=$libdir;;
8122 *) dllsearchpath="$dllsearchpath:$libdir";;
8124 case :$dllsearchpath: in
8125 *":$testbindir:"*) ;;
8126 ::) dllsearchpath=$testbindir;;
8127 *) dllsearchpath="$dllsearchpath:$testbindir";;
8132 # Substitute the hardcoded libdirs into the rpath.
8133 if test -n "$hardcode_libdir_separator" &&
8134 test -n "$hardcode_libdirs"; then
8135 libdir="$hardcode_libdirs"
8136 eval rpath=\" $hardcode_libdir_flag_spec\"
8138 compile_rpath="$rpath"
8142 for libdir in $finalize_rpath; do
8143 if test -n "$hardcode_libdir_flag_spec"; then
8144 if test -n "$hardcode_libdir_separator"; then
8145 if test -z "$hardcode_libdirs"; then
8146 hardcode_libdirs="$libdir"
8148 # Just accumulate the unique libdirs.
8149 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
8150 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8153 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
8158 eval flag=\"$hardcode_libdir_flag_spec\"
8159 rpath="$rpath $flag"
8161 elif test -n "$runpath_var"; then
8162 case "$finalize_perm_rpath " in
8164 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
8168 # Substitute the hardcoded libdirs into the rpath.
8169 if test -n "$hardcode_libdir_separator" &&
8170 test -n "$hardcode_libdirs"; then
8171 libdir="$hardcode_libdirs"
8172 eval rpath=\" $hardcode_libdir_flag_spec\"
8174 finalize_rpath="$rpath"
8176 if test -n "$libobjs" && test "$build_old_libs" = yes; then
8177 # Transform all the library objects into standard objects.
8178 compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
8179 finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
8182 func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
8184 # template prelinking step
8185 if test -n "$prelink_cmds"; then
8186 func_execute_cmds "$prelink_cmds" 'exit $?'
8189 wrappers_required=yes
8191 *cygwin* | *mingw* )
8192 if test "$build_libtool_libs" != yes; then
8193 wrappers_required=no
8197 # Disable wrappers for cegcc, we are cross compiling anyway.
8198 wrappers_required=no
8201 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
8202 wrappers_required=no
8206 if test "$wrappers_required" = no; then
8207 # Replace the output file specification.
8208 compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
8209 link_command="$compile_command$compile_rpath"
8211 # We have no uninstalled library dependencies, so finalize right now.
8213 func_show_eval "$link_command" 'exit_status=$?'
8215 # Delete the generated files.
8216 if test -f "$output_objdir/${outputname}S.${objext}"; then
8217 func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
8223 if test -n "$compile_shlibpath$finalize_shlibpath"; then
8224 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
8226 if test -n "$finalize_shlibpath"; then
8227 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
8232 if test -n "$runpath_var"; then
8233 if test -n "$perm_rpath"; then
8234 # We should set the runpath_var.
8236 for dir in $perm_rpath; do
8239 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
8241 if test -n "$finalize_perm_rpath"; then
8242 # We should set the runpath_var.
8244 for dir in $finalize_perm_rpath; do
8247 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
8251 if test "$no_install" = yes; then
8252 # We don't need to create a wrapper script.
8253 link_command="$compile_var$compile_command$compile_rpath"
8254 # Replace the output file specification.
8255 link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
8256 # Delete the old output file.
8257 $opt_dry_run || $RM $output
8258 # Link the executable and exit
8259 func_show_eval "$link_command" 'exit $?'
8263 if test "$hardcode_action" = relink; then
8264 # Fast installation is not supported
8265 link_command="$compile_var$compile_command$compile_rpath"
8266 relink_command="$finalize_var$finalize_command$finalize_rpath"
8268 func_warning "this platform does not like uninstalled shared libraries"
8269 func_warning "\`$output' will be relinked during installation"
8271 if test "$fast_install" != no; then
8272 link_command="$finalize_var$compile_command$finalize_rpath"
8273 if test "$fast_install" = yes; then
8274 relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
8276 # fast_install is set to needless
8280 link_command="$compile_var$compile_command$compile_rpath"
8281 relink_command="$finalize_var$finalize_command$finalize_rpath"
8285 # Replace the output file specification.
8286 link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
8288 # Delete the old output files.
8289 $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
8291 func_show_eval "$link_command" 'exit $?'
8293 # Now create the wrapper script.
8294 func_verbose "creating $output"
8296 # Quote the relink command for shipping.
8297 if test -n "$relink_command"; then
8298 # Preserve any variables that may affect compiler behavior
8299 for var in $variables_saved_for_relink; do
8300 if eval test -z \"\${$var+set}\"; then
8301 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
8302 elif eval var_value=\$$var; test -z "$var_value"; then
8303 relink_command="$var=; export $var; $relink_command"
8305 func_quote_for_eval "$var_value"
8306 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
8309 relink_command="(cd `pwd`; $relink_command)"
8310 relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
8313 # Quote $ECHO for shipping.
8314 if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
8316 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
8317 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
8319 qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
8321 qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
8324 # Only actually do things if not in dry run mode.
8326 # win32 will think the script is a binary if it has
8327 # a .exe suffix, so we strip it off here.
8329 *.exe) func_stripname '' '.exe' "$output"
8330 output=$func_stripname_result ;;
8332 # test for cygwin because mv fails w/o .exe extensions
8336 func_stripname '' '.exe' "$outputname"
8337 outputname=$func_stripname_result ;;
8341 *cygwin* | *mingw* )
8342 func_dirname_and_basename "$output" "" "."
8343 output_name=$func_basename_result
8344 output_path=$func_dirname_result
8345 cwrappersource="$output_path/$objdir/lt-$output_name.c"
8346 cwrapper="$output_path/$output_name.exe"
8347 $RM $cwrappersource $cwrapper
8348 trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
8350 func_emit_cwrapperexe_src > $cwrappersource
8352 # The wrapper executable is built using the $host compiler,
8353 # because it contains $host paths and files. If cross-
8354 # compiling, it, like the target executable, must be
8355 # executed on the $host or under an emulation environment.
8357 $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
8361 # Now, create the wrapper script for func_source use:
8362 func_ltwrapper_scriptname $cwrapper
8363 $RM $func_ltwrapper_scriptname_result
8364 trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
8366 # note: this script will not be executed, so do not chmod.
8367 if test "x$build" = "x$host" ; then
8368 $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
8370 func_emit_wrapper no > $func_ltwrapper_scriptname_result
8376 trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
8378 func_emit_wrapper no > $output
8387 # See if we need to build an old-fashioned archive.
8388 for oldlib in $oldlibs; do
8390 if test "$build_libtool_libs" = convenience; then
8391 oldobjs="$libobjs_save $symfileobj"
8392 addlibs="$convenience"
8393 build_libtool_libs=no
8395 if test "$build_libtool_libs" = module; then
8396 oldobjs="$libobjs_save"
8397 build_libtool_libs=no
8399 oldobjs="$old_deplibs $non_pic_objects"
8400 if test "$preload" = yes && test -f "$symfileobj"; then
8401 oldobjs="$oldobjs $symfileobj"
8404 addlibs="$old_convenience"
8407 if test -n "$addlibs"; then
8408 gentop="$output_objdir/${outputname}x"
8409 generated="$generated $gentop"
8411 func_extract_archives $gentop $addlibs
8412 oldobjs="$oldobjs $func_extract_archives_result"
8415 # Do each command in the archive commands.
8416 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
8417 cmds=$old_archive_from_new_cmds
8420 # Add any objects from preloaded convenience libraries
8421 if test -n "$dlprefiles"; then
8422 gentop="$output_objdir/${outputname}x"
8423 generated="$generated $gentop"
8425 func_extract_archives $gentop $dlprefiles
8426 oldobjs="$oldobjs $func_extract_archives_result"
8429 # POSIX demands no paths to be encoded in archives. We have
8430 # to avoid creating archives with duplicate basenames if we
8431 # might have to extract them afterwards, e.g., when creating a
8432 # static archive out of a convenience library, or when linking
8433 # the entirety of a libtool archive into another (currently
8434 # not supported by libtool).
8435 if (for obj in $oldobjs
8437 func_basename "$obj"
8438 $ECHO "$func_basename_result"
8439 done | sort | sort -uc >/dev/null 2>&1); then
8442 $ECHO "copying selected object files to avoid basename conflicts..."
8443 gentop="$output_objdir/${outputname}x"
8444 generated="$generated $gentop"
8445 func_mkdir_p "$gentop"
8446 save_oldobjs=$oldobjs
8449 for obj in $save_oldobjs
8451 func_basename "$obj"
8452 objbase="$func_basename_result"
8453 case " $oldobjs " in
8454 " ") oldobjs=$obj ;;
8457 # Make sure we don't pick an alternate name that also
8459 newobj=lt$counter-$objbase
8460 func_arith $counter + 1
8461 counter=$func_arith_result
8462 case " $oldobjs " in
8463 *[\ /]"$newobj "*) ;;
8464 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
8467 func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
8468 oldobjs="$oldobjs $gentop/$newobj"
8470 *) oldobjs="$oldobjs $obj" ;;
8474 eval cmds=\"$old_archive_cmds\"
8477 len=$func_len_result
8478 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
8479 cmds=$old_archive_cmds
8481 # the command line is too long to link in one step, link in parts
8482 func_verbose "using piecewise archive linking..."
8487 save_oldobjs=$oldobjs
8489 # Is there a better way of finding the last object in the list?
8490 for obj in $save_oldobjs
8494 eval test_cmds=\"$old_archive_cmds\"
8495 func_len " $test_cmds"
8496 len0=$func_len_result
8498 for obj in $save_oldobjs
8501 func_arith $len + $func_len_result
8502 len=$func_arith_result
8503 func_append objlist " $obj"
8504 if test "$len" -lt "$max_cmd_len"; then
8507 # the above command should be used before it gets too long
8509 if test "$obj" = "$last_oldobj" ; then
8512 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
8513 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
8520 if test "X$oldobjs" = "X" ; then
8521 eval cmds=\"\$concat_cmds\"
8523 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
8527 func_execute_cmds "$cmds" 'exit $?'
8530 test -n "$generated" && \
8531 func_show_eval "${RM}r$generated"
8533 # Now create the libtool archive.
8537 test "$build_old_libs" = yes && old_library="$libname.$libext"
8538 func_verbose "creating $output"
8540 # Preserve any variables that may affect compiler behavior
8541 for var in $variables_saved_for_relink; do
8542 if eval test -z \"\${$var+set}\"; then
8543 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
8544 elif eval var_value=\$$var; test -z "$var_value"; then
8545 relink_command="$var=; export $var; $relink_command"
8547 func_quote_for_eval "$var_value"
8548 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
8551 # Quote the link command for shipping.
8552 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
8553 relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
8554 if test "$hardcode_automatic" = yes ; then
8558 # Only create the output if not a dry run.
8560 for installed in no yes; do
8561 if test "$installed" = yes; then
8562 if test -z "$install_libdir"; then
8565 output="$output_objdir/$outputname"i
8566 # Replace all uninstalled libtool libraries with the installed ones
8568 for deplib in $dependency_libs; do
8571 func_basename "$deplib"
8572 name="$func_basename_result"
8573 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
8574 test -z "$libdir" && \
8575 func_fatal_error "\`$deplib' is not a valid libtool archive"
8576 newdependency_libs="$newdependency_libs $libdir/$name"
8578 *) newdependency_libs="$newdependency_libs $deplib" ;;
8581 dependency_libs="$newdependency_libs"
8584 for lib in $dlfiles; do
8587 func_basename "$lib"
8588 name="$func_basename_result"
8589 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
8590 test -z "$libdir" && \
8591 func_fatal_error "\`$lib' is not a valid libtool archive"
8592 newdlfiles="$newdlfiles $libdir/$name"
8594 *) newdlfiles="$newdlfiles $lib" ;;
8597 dlfiles="$newdlfiles"
8599 for lib in $dlprefiles; do
8602 # Only pass preopened files to the pseudo-archive (for
8603 # eventual linking with the app. that links it) if we
8604 # didn't already link the preopened objects directly into
8606 func_basename "$lib"
8607 name="$func_basename_result"
8608 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
8609 test -z "$libdir" && \
8610 func_fatal_error "\`$lib' is not a valid libtool archive"
8611 newdlprefiles="$newdlprefiles $libdir/$name"
8615 dlprefiles="$newdlprefiles"
8618 for lib in $dlfiles; do
8620 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
8621 *) abs=`pwd`"/$lib" ;;
8623 newdlfiles="$newdlfiles $abs"
8625 dlfiles="$newdlfiles"
8627 for lib in $dlprefiles; do
8629 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
8630 *) abs=`pwd`"/$lib" ;;
8632 newdlprefiles="$newdlprefiles $abs"
8634 dlprefiles="$newdlprefiles"
8637 # place dlname in correct position for cygwin
8639 case $host,$output,$installed,$module,$dlname in
8640 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
8643 # $outputname - a libtool library file
8644 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
8646 # Please DO NOT delete this file!
8647 # It is necessary for linking the library.
8649 # The name that we can dlopen(3).
8652 # Names of this library.
8653 library_names='$library_names'
8655 # The name of the static archive.
8656 old_library='$old_library'
8658 # Linker flags that can not go in dependency_libs.
8659 inherited_linker_flags='$new_inherited_linker_flags'
8661 # Libraries that this one depends upon.
8662 dependency_libs='$dependency_libs'
8664 # Names of additional weak libraries provided by this library
8665 weak_library_names='$weak_libs'
8667 # Version information for $libname.
8672 # Is this an already installed library?
8673 installed=$installed
8675 # Should we warn about portability when linking against -modules?
8676 shouldnotlink=$module
8678 # Files to dlopen/dlpreopen
8680 dlpreopen='$dlprefiles'
8682 # Directory that this library needs to be installed in:
8683 libdir='$install_libdir'"
8684 if test "$installed" = no && test "$need_relink" = yes; then
8686 relink_command=\"$relink_command\""
8691 # Do a symbolic link so that the libtool archive can be found in
8692 # LD_LIBRARY_PATH before the program is installed.
8693 func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
8699 { test "$mode" = link || test "$mode" = relink; } &&
8700 func_mode_link ${1+"$@"}
8703 # func_mode_uninstall arg...
8704 func_mode_uninstall ()
8712 # This variable tells wrapper scripts just to set variables rather
8713 # than running their programs.
8714 libtool_install_magic="$magic"
8719 -f) RM="$RM $arg"; rmforce=yes ;;
8720 -*) RM="$RM $arg" ;;
8721 *) files="$files $arg" ;;
8726 func_fatal_help "you must specify an RM program"
8730 origobjdir="$objdir"
8731 for file in $files; do
8732 func_dirname "$file" "" "."
8733 dir="$func_dirname_result"
8734 if test "X$dir" = X.; then
8735 objdir="$origobjdir"
8737 objdir="$dir/$origobjdir"
8739 func_basename "$file"
8740 name="$func_basename_result"
8741 test "$mode" = uninstall && objdir="$dir"
8743 # Remember objdir for removal later, being careful to avoid duplicates
8744 if test "$mode" = clean; then
8747 *) rmdirs="$rmdirs $objdir" ;;
8751 # Don't error if the file doesn't exist and rm -f was used.
8752 if { test -L "$file"; } >/dev/null 2>&1 ||
8753 { test -h "$file"; } >/dev/null 2>&1 ||
8754 test -f "$file"; then
8756 elif test -d "$file"; then
8759 elif test "$rmforce" = yes; then
8767 # Possibly a libtool archive, so verify it.
8768 if func_lalib_p "$file"; then
8769 func_source $dir/$name
8771 # Delete the libtool libraries and symlinks.
8772 for n in $library_names; do
8773 rmfiles="$rmfiles $objdir/$n"
8775 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
8779 case " $library_names " in
8780 # " " in the beginning catches empty $dlname
8782 *) rmfiles="$rmfiles $objdir/$dlname" ;;
8784 test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
8787 if test -n "$library_names"; then
8788 # Do each command in the postuninstall commands.
8789 func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
8792 if test -n "$old_library"; then
8793 # Do each command in the old_postuninstall commands.
8794 func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
8796 # FIXME: should reinstall the best remaining shared library.
8803 # Possibly a libtool object, so verify it.
8804 if func_lalib_p "$file"; then
8807 func_source $dir/$name
8809 # Add PIC object to the list of files to remove.
8810 if test -n "$pic_object" &&
8811 test "$pic_object" != none; then
8812 rmfiles="$rmfiles $dir/$pic_object"
8815 # Add non-PIC object to the list of files to remove.
8816 if test -n "$non_pic_object" &&
8817 test "$non_pic_object" != none; then
8818 rmfiles="$rmfiles $dir/$non_pic_object"
8824 if test "$mode" = clean ; then
8828 func_stripname '' '.exe' "$file"
8829 file=$func_stripname_result
8830 func_stripname '' '.exe' "$name"
8831 noexename=$func_stripname_result
8832 # $file with .exe has already been added to rmfiles,
8833 # add $file without .exe
8834 rmfiles="$rmfiles $file"
8837 # Do a test to see if this is a libtool program.
8838 if func_ltwrapper_p "$file"; then
8839 if func_ltwrapper_executable_p "$file"; then
8840 func_ltwrapper_scriptname "$file"
8842 func_source $func_ltwrapper_scriptname_result
8843 rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
8846 func_source $dir/$noexename
8849 # note $name still contains .exe if it was in $file originally
8850 # as does the version of $file that was added into $rmfiles
8851 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
8852 if test "$fast_install" = yes && test -n "$relink_command"; then
8853 rmfiles="$rmfiles $objdir/lt-$name"
8855 if test "X$noexename" != "X$name" ; then
8856 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
8862 func_show_eval "$RM $rmfiles" 'exit_status=1'
8864 objdir="$origobjdir"
8866 # Try to remove the ${objdir}s in the directories where we deleted files
8867 for dir in $rmdirs; do
8868 if test -d "$dir"; then
8869 func_show_eval "rmdir $dir >/dev/null 2>&1"
8876 { test "$mode" = uninstall || test "$mode" = clean; } &&
8877 func_mode_uninstall ${1+"$@"}
8879 test -z "$mode" && {
8880 help="$generic_help"
8881 func_fatal_help "you must specify a MODE"
8884 test -z "$exec_cmd" && \
8885 func_fatal_help "invalid operation mode \`$mode'"
8887 if test -n "$exec_cmd"; then
8888 eval exec "$exec_cmd"
8895 # The TAGs below are defined such that we never get into a situation
8896 # in which we disable both kinds of libraries. Given conflicting
8897 # choices, we go for a static library, that is the most portable,
8898 # since we can't tell whether shared libraries were disabled because
8899 # the user asked for that or because the platform doesn't support
8900 # them. This is particularly important on AIX, because we don't
8901 # support having both static and shared libraries enabled at the same
8902 # time on that platform, so we default to a shared-only configuration.
8903 # If a disable-shared tag is given, we'll fallback to a static-only
8904 # configuration. But we'll never go from static-only to shared-only.
8906 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
8907 build_libtool_libs=no
8909 # ### END LIBTOOL TAG CONFIG: disable-shared
8911 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
8912 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
8913 # ### END LIBTOOL TAG CONFIG: disable-static
8922 # ### BEGIN LIBTOOL TAG CONFIG: CXX
8924 # The linker used to build libraries.
8925 LD="/usr/libexec/gcc/armv7l-tizen-linux-gnueabi/4.5.3/ld"
8927 # Commands used to build an old-style archive.
8928 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
8930 # A language specific compiler.
8933 # Is the compiler the GNU compiler?
8936 # Compiler flag to turn off builtin functions.
8937 no_builtin_flag=" -fno-builtin"
8939 # How to pass a linker flag through the compiler.
8942 # Additional compiler flags for building library objects.
8943 pic_flag=" -fPIC -DPIC"
8945 # Compiler flag to prevent dynamic linking.
8948 # Does compiler simultaneously support -c and -o options?
8951 # Whether or not to add -lc for building shared libraries.
8952 build_libtool_need_lc=no
8954 # Whether or not to disallow shared libs when runtime libs are static.
8955 allow_libtool_libs_with_static_runtimes=no
8957 # Compiler flag to allow reflexive dlopens.
8958 export_dynamic_flag_spec="\${wl}--export-dynamic"
8960 # Compiler flag to generate shared objects directly from archives.
8961 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
8963 # Whether the compiler copes with passing no objects directly.
8964 compiler_needs_object="no"
8966 # Create an old-style archive from a shared archive.
8967 old_archive_from_new_cmds=""
8969 # Create a temporary old-style archive to link instead of a shared archive.
8970 old_archive_from_expsyms_cmds=""
8972 # Commands used to build a shared archive.
8973 archive_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
8974 archive_expsym_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
8976 # Commands used to build a loadable module if different from building
8979 module_expsym_cmds=""
8981 # Whether we are building with GNU ld or not.
8984 # Flag that allows shared libraries with undefined symbols to be built.
8985 allow_undefined_flag=""
8987 # Flag that enforces no undefined symbols.
8988 no_undefined_flag=""
8990 # Flag to hardcode $libdir into a binary during linking.
8991 # This must work even if $libdir does not exist
8992 hardcode_libdir_flag_spec="\${wl}-rpath \${wl}\$libdir"
8994 # If ld is used when linking, flag to hardcode $libdir into a binary
8995 # during linking. This must work even if $libdir does not exist.
8996 hardcode_libdir_flag_spec_ld=""
8998 # Whether we need a single "-rpath" flag with a separated argument.
8999 hardcode_libdir_separator=""
9001 # Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
9002 # DIR into the resulting binary.
9005 # Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
9006 # DIR into the resulting binary and the resulting library dependency is
9007 # "absolute",i.e impossible to change by setting ${shlibpath_var} if the
9008 # library is relocated.
9009 hardcode_direct_absolute=no
9011 # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
9012 # into the resulting binary.
9015 # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
9016 # into the resulting binary.
9017 hardcode_shlibpath_var=unsupported
9019 # Set to "yes" if building a shared library automatically hardcodes DIR
9020 # into the library and all subsequent libraries and executables linked
9022 hardcode_automatic=no
9024 # Set to yes if linker adds runtime paths of dependent libraries
9025 # to runtime path list.
9028 # Whether libtool must link a program against all its dependency libraries.
9031 # Fix the shell variable $srcfile for the compiler.
9034 # Set to "yes" if exported symbols are required.
9035 always_export_symbols=no
9037 # The commands to list exported symbols.
9038 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
9040 # Symbols that should not be listed in the preloaded symbols.
9041 exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
9043 # Symbols that must always be exported.
9046 # Commands necessary for linking programs (against libraries) with templates.
9049 # Specify filename containing input files.
9052 # How to hardcode a shared library path into an executable.
9053 hardcode_action=immediate
9055 # The directories searched by this compiler when creating a shared library.
9056 compiler_lib_search_dirs="/usr/lib/gcc/armv7l-tizen-linux-gnueabi/4.5.3 //lib //usr/lib"
9058 # Dependencies to place before and after the objects being linked to
9059 # create a shared library.
9060 predep_objects="//usr/lib/crti.o /usr/lib/gcc/armv7l-tizen-linux-gnueabi/4.5.3/crtbeginS.o"
9061 postdep_objects="/usr/lib/gcc/armv7l-tizen-linux-gnueabi/4.5.3/crtendS.o //usr/lib/crtn.o"
9063 postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
9065 # The library search path used internally by the compiler when linking
9067 compiler_lib_search_path="-L/usr/lib/gcc/armv7l-tizen-linux-gnueabi/4.5.3 -L//lib -L//usr/lib"
9069 # ### END LIBTOOL TAG CONFIG: CXX