3 # libtoolT - Provide generalized library-building support services.
4 # Generated automatically by (GNU )
5 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
7 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
8 # Free Software Foundation, Inc.
10 # This file is part of GNU Libtool:
11 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
13 # This program is free software; you can redistribute it and/or modify
14 # it under the terms of the GNU General Public License as published by
15 # the Free Software Foundation; either version 2 of the License, or
16 # (at your option) any later version.
18 # This program is distributed in the hope that it will be useful, but
19 # WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 # General Public License for more details.
23 # You should have received a copy of the GNU General Public License
24 # along with this program; if not, write to the Free Software
25 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27 # As a special exception to the GNU General Public License, if you
28 # distribute this file as part of a program that contains a
29 # configuration script generated by Autoconf, you may include it under
30 # the same distribution terms that you use for the rest of that program.
32 # A sed program that does not truncate output.
35 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
36 Xsed
="/bin/sed -e 1s/^X//"
38 # The HP-UX ksh and POSIX shell print the target directory to stdout
40 (unset CDPATH
) >/dev
/null
2>&1 && unset CDPATH
42 # The names of the tagged configurations supported by this script.
45 # ### BEGIN LIBTOOL CONFIG
47 # Libtool was configured on host scorpion:
49 # Shell to use when invoking shell scripts.
52 # Whether or not to build shared libraries.
53 build_libtool_libs
=yes
55 # Whether or not to build static libraries.
58 # Whether or not to add -lc for building shared libraries.
59 build_libtool_need_lc
=no
61 # Whether or not to disallow shared libs when runtime libs are static
62 allow_libtool_libs_with_static_runtimes
=no
64 # Whether or not to optimize for fast installation.
68 host_alias
=i686-pc-linux-gnu
69 host=i686-pc-linux-gnu
74 build
=i686-pc-linux-gnu
77 # An echo program that does not interpret backslashes.
87 # A language-specific compiler.
90 # Is the compiler the GNU C compiler?
96 # The linker used to build libraries.
97 LD
="/usr/i686-pc-linux-gnu/bin/ld"
99 # Whether we need hard or soft links.
102 # A BSD-compatible nm program.
105 # A symbol stripping program
108 # Used to examine libraries when file_magic_cmd begins "file"
111 # Used on cygwin: DLL creation program.
114 # Used on cygwin: object dumper.
117 # Used on cygwin: assembler.
120 # The name of the directory that contains temporary libtool files.
123 # How to create reloadable object files.
125 reload_cmds
="\$LD\$reload_flag -o \$output\$reload_objs"
127 # How to pass a linker flag through the compiler.
130 # Object file suffix (normally "o").
133 # Old archive suffix (normally "a").
136 # Shared library suffix (normally ".so").
139 # Executable file suffix (normally "").
142 # Additional compiler flags for building library objects.
143 pic_flag
=" -fPIC -DPIC"
146 # What is the maximum length of a command?
149 # Does compiler simultaneously support -c and -o options?
152 # Must we lock files when doing compilation?
155 # Do we need the lib prefix for modules?
158 # Do we need a version for libraries?
161 # Whether dlopen is supported.
162 dlopen_support
=unknown
164 # Whether dlopen of programs is supported.
167 # Whether dlopen of statically linked programs is supported.
168 dlopen_self_static
=unknown
170 # Compiler flag to prevent dynamic linking.
171 link_static_flag
="-static"
173 # Compiler flag to turn off builtin functions.
174 no_builtin_flag
=" -fno-builtin"
176 # Compiler flag to allow reflexive dlopens.
177 export_dynamic_flag_spec
="\${wl}--export-dynamic"
179 # Compiler flag to generate shared objects directly from archives.
180 whole_archive_flag_spec
="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
182 # Compiler flag to generate thread-safe objects.
183 thread_safe_flag_spec
=""
185 # Library versioning type.
188 # Format of library name prefix.
189 libname_spec
="lib\$name"
191 # List of archive names. First name is the real one, the rest are links.
192 # The last name is the one that the linker finds with -lNAME.
193 library_names_spec
="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
195 # The coded name of the library, if different from the real name.
196 soname_spec
="\${libname}\${release}\${shared_ext}\$major"
198 # Commands used to build and install an old-style archive.
200 old_archive_cmds
="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
201 old_postinstall_cmds
="\$RANLIB \$oldlib~chmod 644 \$oldlib"
202 old_postuninstall_cmds
=""
204 # Create an old-style archive from a shared archive.
205 old_archive_from_new_cmds
=""
207 # Create a temporary old-style archive to link instead of a shared archive.
208 old_archive_from_expsyms_cmds
=""
210 # Commands used to build and install a shared archive.
211 archive_cmds
="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
212 archive_expsym_cmds
="\$echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
213 cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
214 \$echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
215 \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
217 postuninstall_cmds
=""
219 # Commands used to build a loadable module (assumed same as above if empty)
221 module_expsym_cmds
=""
223 # Commands to strip libraries.
224 old_striplib
="strip --strip-debug"
225 striplib
="strip --strip-unneeded"
227 # Dependencies to place before the objects being linked to create a
231 # Dependencies to place after the objects being linked to create a
235 # Dependencies to place before the objects being linked to create a
239 # Dependencies to place after the objects being linked to create a
243 # The library search path used internally by the compiler when linking
245 compiler_lib_search_path
=""
247 # Method to check whether dependent libraries are shared objects.
248 deplibs_check_method
="pass_all"
250 # Command to use when deplibs_check_method == file_magic.
251 file_magic_cmd
="\$MAGIC_CMD"
253 # Flag that allows shared libraries with undefined symbols to be built.
254 allow_undefined_flag
=""
256 # Flag that forces no undefined symbols.
259 # Commands used to finish a libtool library installation in a directory.
260 finish_cmds
="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
262 # Same as above, but a single script fragment to be evaled but not shown.
265 # Take the output of nm and produce a listing of raw symbols and C names.
266 global_symbol_pipe
="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
268 # Transform the output of nm in a proper C declaration
269 global_symbol_to_cdecl
="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
271 # Transform the output of nm in a C name address pair
272 global_symbol_to_c_name_address
="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
274 # This is the shared library runtime path variable.
275 runpath_var
=LD_RUN_PATH
277 # This is the shared library path variable.
278 shlibpath_var
=LD_LIBRARY_PATH
280 # Is shlibpath searched before the hard-coded library search path?
281 shlibpath_overrides_runpath
=no
283 # How to hardcode a shared library path into an executable.
284 hardcode_action
=immediate
286 # Whether we should hardcode library paths into libraries.
287 hardcode_into_libs
=yes
289 # Flag to hardcode $libdir into a binary during linking.
290 # This must work even if $libdir does not exist.
291 hardcode_libdir_flag_spec
="\${wl}--rpath \${wl}\$libdir"
293 # If ld is used when linking, flag to hardcode $libdir into
294 # a binary during linking. This must work even if $libdir does
296 hardcode_libdir_flag_spec_ld
=""
298 # Whether we need a single -rpath flag with a separated argument.
299 hardcode_libdir_separator
=""
301 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
305 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
309 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
310 # the resulting binary.
311 hardcode_shlibpath_var
=unsupported
313 # Set to yes if building a shared library automatically hardcodes DIR into the library
314 # and all subsequent libraries and executables linked against it.
315 hardcode_automatic
=no
317 # Variables whose values should be saved in libtool wrapper scripts and
318 # restored at relink time.
319 variables_saved_for_relink
="PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
321 # Whether libtool must link a program against all its dependency libraries.
322 link_all_deplibs
=unknown
324 # Compile-time system search path for libraries
325 sys_lib_search_path_spec
=" /usr/lib/gcc/i686-pc-linux-gnu/3.4.6/ /usr/lib/gcc/i686-pc-linux-gnu/3.4.6/ /usr/lib/gcc/i686-pc-linux-gnu/3.4.6/../../../../i686-pc-linux-gnu/lib/i686-pc-linux-gnu/3.4.6/ /usr/lib/gcc/i686-pc-linux-gnu/3.4.6/../../../../i686-pc-linux-gnu/lib/ /usr/lib/gcc/i686-pc-linux-gnu/3.4.6/../../../i686-pc-linux-gnu/3.4.6/ /usr/lib/gcc/i686-pc-linux-gnu/3.4.6/../../../ /lib/i686-pc-linux-gnu/3.4.6/ /lib/ /usr/lib/i686-pc-linux-gnu/3.4.6/ /usr/lib/"
327 # Run-time system search path for libraries
328 sys_lib_dlsearch_path_spec
="/lib /usr/lib # ld.so.conf autogenerated by env-update; make all changes to # contents of /etc/env.d directory /usr/local/lib //usr//lib/opengl/xorg-x11/lib /usr/i686-pc-linux-gnu/lib /usr/lib/gcc/i686-pc-linux-gnu/3.4.6 /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6 /usr/lib/gcc/i686-pc-linux-gnu/4.1.1 /usr/lib/nspr /usr/lib/nss /usr/lib/qt4 /usr/kde/3.5/lib /usr/qt/3/lib "
330 # Fix the shell variable $srcfile for the compiler.
333 # Set to yes if exported symbols are required.
334 always_export_symbols
=no
336 # The commands to list exported symbols.
337 export_symbols_cmds
="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
339 # The commands to extract the exported symbol list from a shared archive.
340 extract_expsyms_cmds
=""
342 # Symbols that should not be listed in the preloaded symbols.
343 exclude_expsyms
="_GLOBAL_OFFSET_TABLE_"
345 # Symbols that must always be exported.
348 # ### END LIBTOOL CONFIG
350 # ltmain.sh - Provide generalized library-building support services.
351 # NOTE: Changing this file will not affect anything until you rerun configure.
353 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
354 # Free Software Foundation, Inc.
355 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
357 # This program is free software; you can redistribute it and/or modify
358 # it under the terms of the GNU General Public License as published by
359 # the Free Software Foundation; either version 2 of the License, or
360 # (at your option) any later version.
362 # This program is distributed in the hope that it will be useful, but
363 # WITHOUT ANY WARRANTY; without even the implied warranty of
364 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
365 # General Public License for more details.
367 # You should have received a copy of the GNU General Public License
368 # along with this program; if not, write to the Free Software
369 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
371 # As a special exception to the GNU General Public License, if you
372 # distribute this file as part of a program that contains a
373 # configuration script generated by Autoconf, you may include it under
374 # the same distribution terms that you use for the rest of that program.
378 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
379 # is ksh but when the shell is invoked as "sh" and the current value of
380 # the _XPG environment variable is not equal to 1 (one), the special
381 # positional parameter $0, within a function call, is the name of the
385 # define SED for historic ltconfig's generated by Libtool 1.3
386 test -z "$SED" && SED
=sed
388 # The name of this program:
389 progname
=`echo "$progpath" | $SED $basename`
399 TIMESTAMP
=" (1.1220.2.365 2005/12/18 22:14:06)"
401 # See if we are running on zsh, and set the options which allow our
402 # commands through without removal of \ escapes.
403 if test -n "${ZSH_VERSION+set}" ; then
406 # Same for EGREP, and just to be sure, do LTCC as well
407 if test "X$EGREP" = X
; then
410 if test "X$LTCC" = X
; then
413 # Same for EGREP, and just to be sure, do LTCC as well
414 if test "x$EGREP" = x
; then
417 if test "x$LTCC" = x
; then
421 # Check that we have a working $echo.
422 if test "X$1" = X--no-reexec
; then
423 # Discard the --no-reexec flag, and continue.
425 elif test "X$1" = X--fallback-echo
; then
426 # Avoid inline document here, it may be left over
428 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
429 # Yippee, $echo works!
432 # Restart under the correct shell, and then maybe $echo will work.
433 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
436 if test "X$1" = X--fallback-echo
; then
437 # used as fallback echo
446 help="Try \`$progname --help' for more information."
447 magic
="%%%MAGIC variable%%%"
452 # Sed substitution that helps us do robust quoting. It backslashifies
453 # metacharacters that are still active within double-quoted strings.
454 Xsed
="${SED}"' -e 1s/^X//'
455 sed_quote_subst
='s/\([\\`\\"$\\\\]\)/\\\1/g'
456 # test EBCDIC or ASCII
457 case `echo X|tr X '\101'` in
458 A
) # ASCII based system
459 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
461 NL2SP
='tr \015\012 \040\040'
463 *) # EBCDIC based system
465 NL2SP
='tr \r\n \100\100'
470 # Only set LANG and LC_ALL to C if already set.
471 # These must not be set unconditionally because not all systems understand
472 # e.g. LANG=C (notably SCO).
473 # We save the old values to restore during execute mode.
474 if test "${LC_ALL+set}" = set; then
475 save_LC_ALL
="$LC_ALL"; LC_ALL
=C
; export LC_ALL
477 if test "${LANG+set}" = set; then
478 save_LANG
="$LANG"; LANG
=C
; export LANG
481 # Make sure IFS has a sensible default
486 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
487 $echo "$modename: not configured to build any kind of library" 1>&2
488 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
503 lo2o
="s/\\.lo\$/.${objext}/"
504 o2lo
="s/\\.${objext}\$/.lo/"
506 if test -z "$max_cmd_len"; then
511 # If test is not a shell built-in, we'll probably end up computing a
512 # maximum length that is only half of the actual maximum length, but
514 while (test "X"`$SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \
515 = "XX$testring") >/dev
/null
2>&1 &&
516 new_result
=`expr "X$testring" : ".*" 2>&1` &&
517 max_cmd_len
="$new_result" &&
518 test $i != 17 # 1/2 MB should be enough
521 testring
="$testring$testring"
524 # Add a significant safety factor because C++ compilers can tack on massive
525 # amounts of additional arguments before passing them to the linker.
526 # It appears as though 1/2 is a usable value.
527 max_cmd_len
=`expr $max_cmd_len \/ 2`
530 if test -z "$max_cmd_len"; then
535 # If test is not a shell built-in, we'll probably end up computing a
536 # maximum length that is only half of the actual maximum length, but
538 while (test "X"`$SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \
539 = "XX$testring") >/dev
/null
2>&1 &&
540 new_result
=`expr "X$testring" : ".*" 2>&1` &&
541 max_cmd_len
="$new_result" &&
542 test "$i" != 17 # 1/2 MB should be enough
545 testring
="$testring$testring"
548 # Add a significant safety factor because C++ compilers can tack on massive
549 # amounts of additional arguments before passing them to the linker.
550 # It appears as though 1/2 is a usable value.
551 max_cmd_len
=`expr $max_cmd_len \/ 2`
554 #####################################
555 # Shell function definitions:
556 # This seems to be the best place for them
558 # func_mktempdir [string]
559 # Make a temporary directory that won't clash with other running
560 # libtool processes, and avoids race conditions if possible. If
561 # given, STRING is the basename for that directory.
564 my_template
="${TMPDIR-/tmp}/${1-$progname}"
566 if test "$run" = ":"; then
567 # Return a directory name, but don't create it in dry-run mode
568 my_tmpdir
="${my_template}-$$"
571 # If mktemp works, use that first and foremost
572 my_tmpdir
=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
574 if test ! -d "$my_tmpdir"; then
575 # Failing that, at least try and use $RANDOM to avoid a race
576 my_tmpdir
="${my_template}-${RANDOM-0}$$"
578 save_mktempdir_umask
=`umask`
581 umask $save_mktempdir_umask
584 # If we're not in dry-run mode, bomb out on failure
585 test -d "$my_tmpdir" ||
{
586 $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
591 $echo "X$my_tmpdir" |
$Xsed
595 # func_win32_libid arg
596 # return the library type of file 'arg'
598 # Need a lot of goo to handle *both* DLLs and import libs
599 # Has to be a shell function in order to 'eat' the argument
600 # that is supplied when $file_magic_command is called.
603 win32_libid_type
="unknown"
604 win32_fileres
=`file -L $1 2>/dev/null`
605 case $win32_fileres in
606 *ar\ archive\ import\ library
*) # definitely import
607 win32_libid_type
="x86 archive import"
609 *ar\ archive
*) # could be an import, or static
610 if eval $OBJDUMP -f $1 |
$SED -e '10q' 2>/dev
/null | \
611 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev
/null
; then
612 win32_nmres
=`eval $NM -f posix -A $1 | \
613 $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
615 import
*) win32_libid_type
="x86 archive import";;
616 *) win32_libid_type
="x86 archive static";;
621 win32_libid_type
="x86 DLL"
623 *executable
*) # but shell scripts are "executable" too...
624 case $win32_fileres in
625 *MS\ Windows\ PE\ Intel
*)
626 win32_libid_type
="x86 DLL"
631 $echo $win32_libid_type
636 # Infer tagged configuration to use if any are available and
637 # if one wasn't chosen via the "--tag" command line option.
638 # Only attempt this if the compiler in the base compile
639 # command doesn't match the default compiler.
640 # arg is usually of the form 'gcc ...'
643 if test -n "$available_tags" && test -z "$tagname"; then
647 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
651 CC_quoted
="$CC_quoted $arg"
654 # Blanks in the command may have been stripped by the calling shell,
655 # but not from the CC environment variable when configure was run.
656 " $CC "* |
"$CC "* |
" `$echo $CC` "* |
"`$echo $CC` "* |
" $CC_quoted"* |
"$CC_quoted "* |
" `$echo $CC_quoted` "* |
"`$echo $CC_quoted` "*) ;;
657 # Blanks at the start of $base_compile will cause this to fail
658 # if we don't check for them as well.
660 for z
in $available_tags; do
661 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev
/null
; then
662 # Evaluate the configuration.
663 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
666 # Double-quote args containing other shell metacharacters.
668 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
672 CC_quoted
="$CC_quoted $arg"
674 # user sometimes does CC=<HOST>-gcc so we need to match that to 'gcc'
675 trimedcc
=`echo ${CC} | $SED -e "s/${host}-//g"`
676 # and sometimes libtool has CC=<HOST>-gcc but user does CC=gcc
677 extendcc
=${host}-${CC}
678 # and sometimes libtool has CC=<OLDHOST>-gcc but user has CC=<NEWHOST>-gcc
679 # (Gentoo-specific hack because we always export $CHOST)
680 mungedcc
=${CHOST-${host}}-${trimedcc}
682 "cc "* |
" cc "* |
"${host}-cc "* |
" ${host}-cc "*|\
683 "gcc "* |
" gcc "* |
"${host}-gcc "* |
" ${host}-gcc "*)
686 "$trimedcc "* |
" $trimedcc "* |
"`$echo $trimedcc` "* |
" `$echo $trimedcc` "*|\
687 "$extendcc "* |
" $extendcc "* |
"`$echo $extendcc` "* |
" `$echo $extendcc` "*|\
688 "$mungedcc "* |
" $mungedcc "* |
"`$echo $mungedcc` "* |
" `$echo $mungedcc` "*|\
689 " $CC "* |
"$CC "* |
" `$echo $CC` "* |
"`$echo $CC` "* |
" $CC_quoted"* |
"$CC_quoted "* |
" `$echo $CC_quoted` "* |
"`$echo $CC_quoted` "*)
690 # The compiler in the base compile command matches
691 # the one in the tagged configuration.
692 # Assume this is the tagged configuration we want.
699 # If $tagname still isn't set, then no tagged configuration
700 # was found and let the user know that the "--tag" command
701 # line option must be used.
702 if test -z "$tagname"; then
703 $echo "$modename: unable to infer tagged configuration"
704 $echo "$modename: specify a tag with \`--tag'" 1>&2
707 # $echo "$modename: using $tagname tagged configuration"
715 # func_extract_an_archive dir oldlib
716 func_extract_an_archive
()
718 f_ex_an_ar_dir
="$1"; shift
719 f_ex_an_ar_oldlib
="$1"
721 $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
722 $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" ||
exit $?
723 if ($AR t
"$f_ex_an_ar_oldlib" |
sort |
sort -uc >/dev
/null
2>&1); then
726 $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
731 # func_extract_archives gentop oldlib ...
732 func_extract_archives
()
734 my_gentop
="$1"; shift
742 $show "${rm}r $my_gentop"
743 $run ${rm}r
"$my_gentop"
744 $show "$mkdir $my_gentop"
745 $run $mkdir "$my_gentop"
747 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
751 for my_xlib
in $my_oldlibs; do
752 # Extract the objects.
754 [\\/]* |
[A-Za-z
]:[\\/]*) my_xabs
="$my_xlib" ;;
755 *) my_xabs
=`pwd`"/$my_xlib" ;;
757 my_xlib
=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
758 my_xdir
="$my_gentop/$my_xlib"
760 $show "${rm}r $my_xdir"
761 $run ${rm}r
"$my_xdir"
762 $show "$mkdir $my_xdir"
763 $run $mkdir "$my_xdir"
765 if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
770 $show "Extracting $my_xabs"
771 # Do not bother doing anything if just a dry run
772 if test -z "$run"; then
773 darwin_orig_dir
=`pwd`
774 cd $my_xdir ||
exit $?
775 darwin_archive
=$my_xabs
777 darwin_base_archive
=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
778 darwin_arches
=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
779 if test -n "$darwin_arches"; then
780 darwin_arches
=`echo "$darwin_arches" | $SED -e 's/.*are://'`
782 $show "$darwin_base_archive has multiple architectures $darwin_arches"
783 for darwin_arch
in $darwin_arches ; do
784 mkdir
-p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
785 lipo
-thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
786 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
787 func_extract_an_archive
"`pwd`" "${darwin_base_archive}"
789 $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
790 done # $darwin_arches
791 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
792 darwin_filelist
=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
795 for darwin_file
in $darwin_filelist; do
796 darwin_files
=`find unfat-$$ -name $darwin_file -print | $NL2SP`
797 lipo
-create -output "$darwin_file" $darwin_files
798 done # $darwin_filelist
800 cd "$darwin_orig_dir"
802 cd "$darwin_orig_dir"
803 func_extract_an_archive
"$my_xdir" "$my_xabs"
808 func_extract_an_archive
"$my_xdir" "$my_xabs"
811 my_oldobjs
="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
813 func_extract_archives_result
="$my_oldobjs"
815 # End of Shell function definitions
816 #####################################
819 eval std_shrext
=\"$shrext_cmds\"
823 # Parse our command line options once, thoroughly.
824 while test "$#" -gt 0
830 -*=*) optarg
=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
834 # If the previous option needs an argument, assign it.
835 if test -n "$prev"; then
838 execute_dlfiles
="$execute_dlfiles $arg"
842 preserve_args
="${preserve_args}=$arg"
844 # Check whether tagname contains only valid characters
847 $echo "$progname: invalid tag name: $tagname" 1>&2
854 # Don't test for the "default" C tag, as we know, it's there, but
855 # not specially marked.
858 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev
/null
; then
859 taglist
="$taglist $tagname"
860 # Evaluate the configuration.
861 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
863 $echo "$progname: ignoring unknown tag $tagname" 1>&2
878 # Have we seen a non-optional argument yet?
885 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
887 $echo "Copyright (C) 2005 Free Software Foundation, Inc."
888 $echo "This is free software; see the source for copying conditions. There is NO"
889 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
894 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
895 # Now print the configurations for the tags.
896 for tagname
in $taglist; do
897 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
903 $echo "$progname: enabling shell trace mode"
905 preserve_args
="$preserve_args $arg"
914 if test "$build_libtool_libs" = yes; then
915 $echo "enable shared libraries"
917 $echo "disable shared libraries"
919 if test "$build_old_libs" = yes; then
920 $echo "enable static libraries"
922 $echo "disable static libraries"
927 --finish) mode
="finish" ;;
929 --mode) prevopt
="--mode" prev
=mode
;;
930 --mode=*) mode
="$optarg" ;;
932 --preserve-dup-deps) duplicate_deps
="yes" ;;
936 preserve_args
="$preserve_args $arg"
942 preserve_args
="$preserve_args --tag"
945 set tag
"$optarg" ${1+"$@"}
948 preserve_args
="$preserve_args --tag"
957 $echo "$modename: unrecognized option \`$arg'" 1>&2
969 if test -n "$prevopt"; then
970 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
975 case $disable_libs in
979 build_libtool_libs
=no
983 build_old_libs
=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
987 # If this variable is set in any of the actions, the command in it
988 # will be execed at the end. This prevents here-documents from being
989 # left over by shells.
992 if test -z "$show_help"; then
994 # Infer the operation mode.
995 if test -z "$mode"; then
996 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
997 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
999 *cc | cc
* |
*++ | gcc
* |
*-gcc* | g
++* | xlc
*)
1011 *db |
*dbx |
*strace |
*truss
)
1021 # If we have no mode, but dlfiles were specified, then do execute mode.
1022 test -n "$execute_dlfiles" && mode
=execute
1024 # Just use the default operation mode.
1025 if test -z "$mode"; then
1026 if test -n "$nonopt"; then
1027 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
1029 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
1036 # Only execute mode is allowed to have -dlopen flags.
1037 if test -n "$execute_dlfiles" && test "$mode" != execute
; then
1038 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
1043 # Change the help message to a mode-specific one.
1044 generic_help
="$help"
1045 help="Try \`$modename --help --mode=$mode' for more information."
1047 # These modes are in order of execution frequency so that they run quickly.
1049 # libtool compile mode
1051 modename
="$modename: compile"
1052 # Get the compilation command and the source file.
1054 srcfile
="$nonopt" # always keep a non-empty value in "srcfile"
1065 # do not "continue". Instead, add this to base_compile
1077 # Accept any command-line options.
1080 if test -n "$libobj" ; then
1081 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
1088 -static |
-prefer-pic |
-prefer-non-pic)
1099 arg_mode
=arg
# the next one goes into the "base_compile" arg list
1100 continue # The current "srcfile" will either be retained or
1101 ;; # replaced later. I would guess that would be a bug.
1104 args
=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
1106 save_ifs
="$IFS"; IFS
=','
1107 for arg
in $args; do
1110 # Double-quote args containing other shell metacharacters.
1111 # Many Bourne shells cannot handle close brackets correctly
1112 # in scan sets, so we specify it separately.
1114 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1118 lastarg
="$lastarg $arg"
1121 lastarg
=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
1123 # Add the arguments to base_compile.
1124 base_compile
="$base_compile $lastarg"
1129 # Accept the current argument as the source file.
1130 # The previous "srcfile" becomes the current argument.
1137 esac # case $arg_mode
1139 # Aesthetically quote the previous argument.
1140 lastarg
=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
1143 # Double-quote args containing other shell metacharacters.
1144 # Many Bourne shells cannot handle close brackets correctly
1145 # in scan sets, and some SunOS ksh mistreat backslash-escaping
1146 # in scan sets (worked around with variable expansion),
1147 # and furthermore cannot handle '|' '&' '(' ')' in scan sets
1148 # at all, so we specify them separately.
1149 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1150 lastarg
="\"$lastarg\""
1154 base_compile
="$base_compile $lastarg"
1159 $echo "$modename: you must specify an argument for -Xcompile"
1163 $echo "$modename: you must specify a target with \`-o'" 1>&2
1167 # Get the name of the library object.
1168 [ -z "$libobj" ] && libobj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
1172 # Recognize several different file suffixes.
1173 # If the user specifies -o file.o, it is replaced with file.lo
1183 *.class
) xform
=class
;;
1188 *.java
) xform
=java
;;
1191 libobj
=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
1194 *.lo
) obj
=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
1196 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
1201 func_infer_tag
$base_compile
1203 for arg
in $later; do
1222 qlibobj
=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
1224 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1225 qlibobj
="\"$qlibobj\"" ;;
1227 test "X$libobj" != "X$qlibobj" \
1228 && $echo "X$libobj" |
grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
1229 && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
1230 objname
=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
1231 xdir
=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
1232 if test "X$xdir" = "X$obj"; then
1237 lobj
=${xdir}$objdir/$objname
1239 if test -z "$base_compile"; then
1240 $echo "$modename: you must specify a compilation command" 1>&2
1245 # Delete any leftover library objects.
1246 if test "$build_old_libs" = yes; then
1247 removelist
="$obj $lobj $libobj ${libobj}T"
1249 removelist
="$lobj $libobj ${libobj}T"
1252 $run $rm $removelist
1253 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1255 # On Cygwin there's no "real" PIC flag so we must build both object types
1257 cygwin
* | mingw
* | pw32
* | os2
*)
1261 if test "$pic_mode" = no
&& test "$deplibs_check_method" != pass_all
; then
1262 # non-PIC code in shared libraries is not supported
1266 # Calculate the filename of the output object if compiler does
1267 # not support -o with -c
1268 if test "$compiler_c_o" = no
; then
1269 output_obj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.
${objext}
1270 lockfile
="$output_obj.lock"
1271 removelist
="$removelist $output_obj $lockfile"
1272 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1279 # Lock this critical section if it is needed
1280 # We use this script file to make the link, it avoids creating a new file
1281 if test "$need_locks" = yes; then
1282 until $run ln "$srcfile" "$lockfile" 2>/dev
/null
; do
1283 $show "Waiting for $lockfile to be removed"
1286 elif test "$need_locks" = warn
; then
1287 if test -f "$lockfile"; then
1289 *** ERROR, $lockfile exists and contains:
1290 `cat $lockfile 2>/dev/null`
1292 This indicates that another process is trying to use the same
1293 temporary object file, and libtool could not work around it because
1294 your compiler does not support \`-c' and \`-o' together. If you
1295 repeat this compilation, it may succeed, by chance, but you had better
1296 avoid parallel builds (make -j) in this platform, or get a better
1299 $run $rm $removelist
1302 $echo "$srcfile" > "$lockfile"
1305 if test -n "$fix_srcfile_path"; then
1306 eval srcfile
=\"$fix_srcfile_path\"
1308 qsrcfile
=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
1310 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1311 qsrcfile
="\"$qsrcfile\"" ;;
1314 $run $rm "$libobj" "${libobj}T"
1316 # Create a libtool object file (analogous to a ".la" file),
1317 # but don't create it if we're doing a dry run.
1318 test -z "$run" && cat > ${libobj}T
<<EOF
1319 # $libobj - a libtool object file
1320 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
1322 # Please DO NOT delete this file!
1323 # It is necessary for linking the library.
1325 # Name of the PIC object.
1328 # Only build a PIC object if we are building libtool libraries.
1329 if test "$build_libtool_libs" = yes; then
1330 # Without this assignment, base_compile gets emptied.
1331 fbsd_hideous_sh_bug
=$base_compile
1333 if test "$pic_mode" != no
; then
1334 command="$base_compile $qsrcfile $pic_flag"
1336 # Don't build PIC code
1337 command="$base_compile $qsrcfile"
1340 if test ! -d "${xdir}$objdir"; then
1341 $show "$mkdir ${xdir}$objdir"
1342 $run $mkdir ${xdir}$objdir
1344 if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
1349 if test -z "$output_obj"; then
1350 # Place PIC objects in $objdir
1351 command="$command -o $lobj"
1354 $run $rm "$lobj" "$output_obj"
1357 if $run eval "$command"; then :
1359 test -n "$output_obj" && $run $rm $removelist
1363 if test "$need_locks" = warn
&&
1364 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1366 *** ERROR, $lockfile contains:
1367 `cat $lockfile 2>/dev/null`
1369 but it should contain:
1372 This indicates that another process is trying to use the same
1373 temporary object file, and libtool could not work around it because
1374 your compiler does not support \`-c' and \`-o' together. If you
1375 repeat this compilation, it may succeed, by chance, but you had better
1376 avoid parallel builds (make -j) in this platform, or get a better
1379 $run $rm $removelist
1383 # Just move the object if needed, then go on to compile the next one
1384 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1385 $show "$mv $output_obj $lobj"
1386 if $run $mv $output_obj $lobj; then :
1389 $run $rm $removelist
1394 # Append the name of the PIC object to the libtool object file.
1395 test -z "$run" && cat >> ${libobj}T
<<EOF
1396 pic_object='$objdir/$objname'
1400 # Allow error messages only from the first compilation.
1401 if test "$suppress_opt" = yes; then
1402 suppress_output
=' >/dev/null 2>&1'
1405 # No PIC object so indicate it doesn't exist in the libtool
1407 test -z "$run" && cat >> ${libobj}T
<<EOF
1413 # Only build a position-dependent object if we build old libraries.
1414 if test "$build_old_libs" = yes; then
1415 if test "$pic_mode" != yes; then
1416 # Don't build PIC code
1417 command="$base_compile $qsrcfile"
1419 command="$base_compile $qsrcfile $pic_flag"
1421 if test "$compiler_c_o" = yes; then
1422 command="$command -o $obj"
1425 # Suppress compiler output if we already did a PIC compilation.
1426 command="$command$suppress_output"
1427 $run $rm "$obj" "$output_obj"
1429 if $run eval "$command"; then :
1431 $run $rm $removelist
1435 if test "$need_locks" = warn
&&
1436 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1438 *** ERROR, $lockfile contains:
1439 `cat $lockfile 2>/dev/null`
1441 but it should contain:
1444 This indicates that another process is trying to use the same
1445 temporary object file, and libtool could not work around it because
1446 your compiler does not support \`-c' and \`-o' together. If you
1447 repeat this compilation, it may succeed, by chance, but you had better
1448 avoid parallel builds (make -j) in this platform, or get a better
1451 $run $rm $removelist
1455 # Just move the object if needed
1456 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1457 $show "$mv $output_obj $obj"
1458 if $run $mv $output_obj $obj; then :
1461 $run $rm $removelist
1466 # Append the name of the non-PIC object the libtool object file.
1467 # Only append if the libtool object file exists.
1468 test -z "$run" && cat >> ${libobj}T
<<EOF
1469 # Name of the non-PIC object.
1470 non_pic_object='$objname'
1474 # Append the name of the non-PIC object the libtool object file.
1475 # Only append if the libtool object file exists.
1476 test -z "$run" && cat >> ${libobj}T
<<EOF
1477 # Name of the non-PIC object.
1483 $run $mv "${libobj}T" "${libobj}"
1485 # Unlock the critical section if it was locked
1486 if test "$need_locks" != no
; then
1487 $run $rm "$lockfile"
1495 modename
="$modename: link"
1497 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1498 # It is impossible to link a dll without this setting, and
1499 # we shouldn't force the makefile maintainer to figure out
1500 # which system we are compiling for in order to pass an extra
1501 # flag for every libtool invocation.
1502 # allow_undefined=no
1504 # FIXME: Unfortunately, there are problems with the above when trying
1505 # to make a dll which has undefined symbols, in which case not
1506 # even a static library is built. For now, we need to specify
1507 # -no-undefined on the libtool link line when we can be certain
1508 # that all symbols are satisfied, otherwise we get a static library.
1515 libtool_args
="$nonopt"
1516 base_compile
="$nonopt $@"
1517 compile_command
="$nonopt"
1518 finalize_command
="$nonopt"
1531 lib_search_path
=`pwd`
1540 export_symbols_regex
=
1548 notinst_path
= # paths that contain not-installed libtool libraries
1549 precious_files_regex
=
1550 prefer_static_libs
=no
1563 func_infer_tag
$base_compile
1565 # We need to know -static, to get the right output filenames.
1569 -all-static |
-static)
1570 if test "X$arg" = "X-all-static"; then
1571 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1572 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1574 if test -n "$link_static_flag"; then
1575 dlopen_self
=$dlopen_self_static
1577 prefer_static_libs
=yes
1579 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1580 dlopen_self
=$dlopen_self_static
1582 prefer_static_libs
=built
1584 build_libtool_libs
=no
1591 # See if our shared archives depend on static archives.
1592 test -n "$old_archive_from_new_cmds" && build_old_libs
=yes
1594 # Go through the arguments, transforming them on the way.
1595 while test "$#" -gt 0; do
1599 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1600 qarg
=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1604 libtool_args
="$libtool_args $qarg"
1606 # If the previous option needs an argument, assign it.
1607 if test -n "$prev"; then
1610 compile_command
="$compile_command @OUTPUT@"
1611 finalize_command
="$finalize_command @OUTPUT@"
1617 if test "$preload" = no
; then
1618 # Add the symbol object into the linking commands.
1619 compile_command
="$compile_command @SYMFILE@"
1620 finalize_command
="$finalize_command @SYMFILE@"
1624 *.la |
*.lo
) ;; # We handle these cases below.
1626 if test "$dlself" = no
; then
1634 if test "$prev" = dlprefiles
; then
1636 elif test "$prev" = dlfiles
&& test "$dlopen_self" != yes; then
1646 if test "$prev" = dlfiles
; then
1647 dlfiles
="$dlfiles $arg"
1649 dlprefiles
="$dlprefiles $arg"
1657 export_symbols
="$arg"
1658 if test ! -f "$arg"; then
1659 $echo "$modename: symbol file \`$arg' does not exist"
1666 export_symbols_regex
="$arg"
1671 inst_prefix_dir
="$arg"
1676 precious_files_regex
="$arg"
1686 if test -f "$arg"; then
1689 for fil
in `cat $save_arg`
1691 # moreargs="$moreargs $fil"
1693 # A libtool-controlled object.
1695 # Check to see that this really is a libtool object.
1696 if (${SED} -e '2q' $arg |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1701 # If there is no directory component, then add one.
1703 */* |
*\\*) .
$arg ;;
1707 if test -z "$pic_object" || \
1708 test -z "$non_pic_object" ||
1709 test "$pic_object" = none
&& \
1710 test "$non_pic_object" = none
; then
1711 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1715 # Extract subdirectory from the argument.
1716 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1717 if test "X$xdir" = "X$arg"; then
1723 if test "$pic_object" != none
; then
1724 # Prepend the subdirectory the object is found in.
1725 pic_object
="$xdir$pic_object"
1727 if test "$prev" = dlfiles
; then
1728 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1729 dlfiles
="$dlfiles $pic_object"
1733 # If libtool objects are unsupported, then we need to preload.
1738 # CHECK ME: I think I busted this. -Ossama
1739 if test "$prev" = dlprefiles
; then
1740 # Preload the old-style object.
1741 dlprefiles
="$dlprefiles $pic_object"
1746 libobjs
="$libobjs $pic_object"
1751 if test "$non_pic_object" != none
; then
1752 # Prepend the subdirectory the object is found in.
1753 non_pic_object
="$xdir$non_pic_object"
1755 # A standard non-PIC object
1756 non_pic_objects
="$non_pic_objects $non_pic_object"
1757 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1758 arg
="$non_pic_object"
1761 # If the PIC object exists, use it instead.
1762 # $xdir was prepended to $pic_object above.
1763 non_pic_object
="$pic_object"
1764 non_pic_objects
="$non_pic_objects $non_pic_object"
1767 # Only an error if not doing a dry-run.
1768 if test -z "$run"; then
1769 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1774 # Extract subdirectory from the argument.
1775 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1776 if test "X$xdir" = "X$arg"; then
1782 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1783 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1784 libobjs
="$libobjs $pic_object"
1785 non_pic_objects
="$non_pic_objects $non_pic_object"
1790 $echo "$modename: link input file \`$save_arg' does not exist"
1798 # We need an absolute path.
1800 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1802 $echo "$modename: only absolute run-paths are allowed" 1>&2
1806 if test "$prev" = rpath
; then
1809 *) rpath
="$rpath $arg" ;;
1814 *) xrpath
="$xrpath $arg" ;;
1821 compiler_flags
="$compiler_flags $qarg"
1823 compile_command
="$compile_command $qarg"
1824 finalize_command
="$finalize_command $qarg"
1828 linker_flags
="$linker_flags $qarg"
1829 compiler_flags
="$compiler_flags $wl$qarg"
1831 compile_command
="$compile_command $wl$qarg"
1832 finalize_command
="$finalize_command $wl$qarg"
1836 linker_flags
="$linker_flags $qarg"
1837 compiler_flags
="$compiler_flags $qarg"
1839 compile_command
="$compile_command $qarg"
1840 finalize_command
="$finalize_command $qarg"
1848 darwin_framework|darwin_framework_skip
)
1849 test "$prev" = "darwin_framework" && compiler_flags
="$compiler_flags $arg"
1850 compile_command
="$compile_command $arg"
1851 finalize_command
="$finalize_command $arg"
1856 eval "$prev=\"\$arg\""
1861 fi # test -n "$prev"
1867 if test -n "$link_static_flag"; then
1868 compile_command
="$compile_command $link_static_flag"
1869 finalize_command
="$finalize_command $link_static_flag"
1875 # FIXME: remove this flag sometime in the future.
1876 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1900 -export-symbols |
-export-symbols-regex)
1901 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
1902 $echo "$modename: more than one -exported-symbols argument is not allowed"
1905 if test "X$arg" = "X-export-symbols"; then
1913 -framework|
-arch|
-isysroot)
1915 *" ${arg} ${1} "* | *" ${arg} ${1} "*)
1916 prev
=darwin_framework_skip
;;
1917 *) compiler_flags
="$compiler_flags $arg"
1918 prev
=darwin_framework
;;
1920 compile_command
="$compile_command $arg"
1921 finalize_command
="$finalize_command $arg"
1930 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1931 # so, if we see these flags be careful not to treat them like -L
1933 case $with_gcc/$host in
1934 no
/*-*-irix* |
/*-*-irix*)
1935 compile_command
="$compile_command $arg"
1936 finalize_command
="$finalize_command $arg"
1943 dir
=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1944 # We need an absolute path.
1946 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1948 absdir
=`cd "$dir" && pwd`
1949 if test -z "$absdir"; then
1950 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1952 notinst_path
="$notinst_path $dir"
1960 deplibs
="$deplibs -L$dir"
1961 lib_search_path
="$lib_search_path $dir"
1965 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1966 testbindir
=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1967 case :$dllsearchpath: in
1969 *) dllsearchpath
="$dllsearchpath:$dir";;
1971 case :$dllsearchpath: in
1972 *":$testbindir:"*) ;;
1973 *) dllsearchpath
="$dllsearchpath:$testbindir";;
1981 if test "X$arg" = "X-lc" ||
test "X$arg" = "X-lm"; then
1983 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-beos*)
1984 # These systems don't actually have a C or math library (as such)
1988 # These systems don't actually have a C library (as such)
1989 test "X$arg" = "X-lc" && continue
1991 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
1992 # Do not include libc due to us having libc/libc_r.
1993 test "X$arg" = "X-lc" && continue
1995 *-*-rhapsody* |
*-*-darwin1.
[012])
1996 # Rhapsody C and math libraries are in the System framework
1997 deplibs
="$deplibs -framework System"
2000 *-*-sco3.2v5
* |
*-*-sco5v6*)
2001 # Causes problems with __ctype
2002 test "X$arg" = "X-lc" && continue
2004 *-*-sysv4.2uw2
* |
*-*-sysv5* |
*-*-unixware* |
*-*-OpenUNIX*)
2005 # Compiler inserts libc in the correct place for threads to work
2006 test "X$arg" = "X-lc" && continue
2009 elif test "X$arg" = "X-lc_r"; then
2011 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
2012 # Do not include libc_r directly, use -pthread flag.
2017 deplibs
="$deplibs $arg"
2021 # Tru64 UNIX uses -model [arg] to determine the layout of C++
2022 # classes, name mangling, and exception handling.
2024 compile_command
="$compile_command $arg"
2025 compiler_flags
="$compiler_flags $arg"
2026 finalize_command
="$finalize_command $arg"
2031 -mt|
-mthreads|
-kthread|
-Kthread|
-pthread|
-pthreads|
--thread-safe)
2032 compiler_flags
="$compiler_flags $arg"
2033 compile_command
="$compile_command $arg"
2034 finalize_command
="$finalize_command $arg"
2043 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
2044 # -r[0-9][0-9]* specifies the processor on the SGI compiler
2045 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
2046 # +DA*, +DD* enable 64-bit mode on the HP compiler
2047 # -q* pass through compiler args for the IBM compiler
2048 # -m* pass through architecture-specific compiler args for GCC
2049 # -m*, -t[45]*, -txscale* pass through architecture-specific
2050 # compiler args for GCC
2051 # -pg pass through profiling flag for GCC
2052 # @file GCC response files
2053 -64|
-mips[0-9]|
-r[0-9][0-9]*|
-xarch=*|
-xtarget=*|
+DA
*|
+DD
*|
-q*|
-m*|
-pg| \
2054 -t[45]*|
-txscale*|@
*)
2056 # Unknown arguments in both finalize_command and compile_command need
2057 # to be aesthetically quoted because they are evaled later.
2058 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2060 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2064 compile_command
="$compile_command $arg"
2065 finalize_command
="$finalize_command $arg"
2066 compiler_flags
="$compiler_flags $arg"
2082 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
2083 # The PATH hackery in wrapper scripts is required on Windows
2084 # in order for the loader to find any dlls it needs.
2085 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
2086 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
2089 *) no_install
=yes ;;
2106 -precious-files-regex)
2127 dir
=`$echo "X$arg" | $Xsed -e 's/^-R//'`
2128 # We need an absolute path.
2130 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
2132 $echo "$modename: only absolute run-paths are allowed" 1>&2
2138 *) xrpath
="$xrpath $dir" ;;
2144 # The effects of -static are defined in a previous loop.
2145 # We used to do the same as -all-static on platforms that
2146 # didn't have a PIC flag, but the assumption that the effects
2147 # would be equivalent was wrong. It would break on at least
2148 # Digital Unix and AIX.
2168 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
2170 save_ifs
="$IFS"; IFS
=','
2171 for flag
in $args; do
2174 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2179 compiler_flags
="$compiler_flags $flag"
2182 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
2186 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
2188 save_ifs
="$IFS"; IFS
=','
2189 for flag
in $args; do
2192 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2197 compiler_flags
="$compiler_flags $wl$flag"
2198 linker_flags
="$linker_flags $flag"
2201 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
2219 # Some other compiler flag.
2221 # Unknown arguments in both finalize_command and compile_command need
2222 # to be aesthetically quoted because they are evaled later.
2223 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2225 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2232 # A standard object.
2237 # A libtool-controlled object.
2239 # Check to see that this really is a libtool object.
2240 if (${SED} -e '2q' $arg |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
2245 # If there is no directory component, then add one.
2247 */* |
*\\*) .
$arg ;;
2251 if test -z "$pic_object" || \
2252 test -z "$non_pic_object" ||
2253 test "$pic_object" = none
&& \
2254 test "$non_pic_object" = none
; then
2255 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
2259 # Extract subdirectory from the argument.
2260 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2261 if test "X$xdir" = "X$arg"; then
2267 if test "$pic_object" != none
; then
2268 # Prepend the subdirectory the object is found in.
2269 pic_object
="$xdir$pic_object"
2271 if test "$prev" = dlfiles
; then
2272 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
2273 dlfiles
="$dlfiles $pic_object"
2277 # If libtool objects are unsupported, then we need to preload.
2282 # CHECK ME: I think I busted this. -Ossama
2283 if test "$prev" = dlprefiles
; then
2284 # Preload the old-style object.
2285 dlprefiles
="$dlprefiles $pic_object"
2290 libobjs
="$libobjs $pic_object"
2295 if test "$non_pic_object" != none
; then
2296 # Prepend the subdirectory the object is found in.
2297 non_pic_object
="$xdir$non_pic_object"
2299 # A standard non-PIC object
2300 non_pic_objects
="$non_pic_objects $non_pic_object"
2301 if test -z "$pic_object" ||
test "$pic_object" = none
; then
2302 arg
="$non_pic_object"
2305 # If the PIC object exists, use it instead.
2306 # $xdir was prepended to $pic_object above.
2307 non_pic_object
="$pic_object"
2308 non_pic_objects
="$non_pic_objects $non_pic_object"
2311 # Only an error if not doing a dry-run.
2312 if test -z "$run"; then
2313 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
2318 # Extract subdirectory from the argument.
2319 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2320 if test "X$xdir" = "X$arg"; then
2326 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
2327 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
2328 libobjs
="$libobjs $pic_object"
2329 non_pic_objects
="$non_pic_objects $non_pic_object"
2336 deplibs
="$deplibs $arg"
2337 old_deplibs
="$old_deplibs $arg"
2342 # A libtool-controlled library.
2344 if test "$prev" = dlfiles
; then
2345 # This library was specified with -dlopen.
2346 dlfiles
="$dlfiles $arg"
2348 elif test "$prev" = dlprefiles
; then
2349 # The library was specified with -dlpreopen.
2350 dlprefiles
="$dlprefiles $arg"
2353 deplibs
="$deplibs $arg"
2358 # Some other compiler argument.
2360 # Unknown arguments in both finalize_command and compile_command need
2361 # to be aesthetically quoted because they are evaled later.
2362 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2364 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2371 # Now actually substitute the argument into the commands.
2372 if test -n "$arg"; then
2373 compile_command
="$compile_command $arg"
2374 finalize_command
="$finalize_command $arg"
2376 done # argument parsing loop
2378 if test -n "$prev"; then
2379 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
2384 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
2385 eval arg
=\"$export_dynamic_flag_spec\"
2386 compile_command
="$compile_command $arg"
2387 finalize_command
="$finalize_command $arg"
2391 # calculate the name of the file, without its directory
2392 outputname
=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
2393 libobjs_save
="$libobjs"
2395 if test -n "$shlibpath_var"; then
2396 # get the directories listed in $shlibpath_var
2397 eval shlib_search_path
=\
`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2401 eval sys_lib_search_path
=\"$sys_lib_search_path_spec\"
2402 eval sys_lib_dlsearch_path
=\"$sys_lib_dlsearch_path_spec\"
2404 output_objdir
=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2405 if test "X$output_objdir" = "X$output"; then
2406 output_objdir
="$objdir"
2408 output_objdir
="$output_objdir/$objdir"
2410 # Create the object directory.
2411 if test ! -d "$output_objdir"; then
2412 $show "$mkdir $output_objdir"
2413 $run $mkdir $output_objdir
2415 if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
2420 # Determine the type of output
2423 $echo "$modename: you must specify an output file" 1>&2
2427 *.
$libext) linkmode
=oldlib
;;
2428 *.lo |
*.
$objext) linkmode
=obj
;;
2429 *.la
) linkmode
=lib
;;
2430 *) linkmode
=prog
;; # Anything else should be a program.
2434 *cygwin
* |
*mingw
* |
*pw32
*)
2435 # don't eliminate duplications in $postdeps and $predeps
2436 duplicate_compiler_generated_deps
=yes
2439 duplicate_compiler_generated_deps
=$duplicate_deps
2445 # Find all interdependent deplibs by searching for libraries
2446 # that are linked more than once (e.g. -la -lb -la)
2447 for deplib
in $deplibs; do
2448 if test "X$duplicate_deps" = "Xyes" ; then
2450 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2453 libs
="$libs $deplib"
2456 if test "$linkmode" = lib
; then
2457 libs
="$predeps $libs $compiler_lib_search_path $postdeps"
2459 # Compute libraries that are listed more than once in $predeps
2460 # $postdeps and mark them as special (i.e., whose duplicates are
2461 # not to be eliminated).
2463 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2464 for pre_post_dep
in $predeps $postdeps; do
2465 case "$pre_post_deps " in
2466 *" $pre_post_dep "*) specialdeplibs
="$specialdeplibs $pre_post_deps" ;;
2468 pre_post_deps
="$pre_post_deps $pre_post_dep"
2477 need_relink
=no
# whether we're linking any uninstalled libtool libraries
2478 notinst_deplibs
= # not-installed libtool libraries
2482 for file in $dlfiles $dlprefiles; do
2486 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2498 passes
="conv scan dlopen dlpreopen link"
2503 for pass
in $passes; do
2504 if test "$linkmode,$pass" = "lib,link" ||
2505 test "$linkmode,$pass" = "prog,scan"; then
2509 if test "$linkmode" = prog
; then
2511 dlopen
) libs
="$dlfiles" ;;
2512 dlpreopen
) libs
="$dlprefiles" ;;
2513 link
) libs
="$deplibs %DEPLIBS% $dependency_libs" ;;
2516 if test "$pass" = dlopen
; then
2517 # Collect dlpreopened libraries
2518 save_deplibs
="$deplibs"
2521 for deplib
in $libs; do
2525 -mt|
-mthreads|
-kthread|
-Kthread|
-pthread|
-pthreads|
--thread-safe)
2526 if test "$linkmode,$pass" = "prog,link"; then
2527 compile_deplibs
="$deplib $compile_deplibs"
2528 finalize_deplibs
="$deplib $finalize_deplibs"
2530 compiler_flags
="$compiler_flags $deplib"
2535 if test "$linkmode" != lib
&& test "$linkmode" != prog
; then
2536 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2539 name
=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2540 for searchdir
in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2541 for search_ext
in .la
$std_shrext .so .a
; do
2542 # Search the libtool library
2543 lib
="$searchdir/lib${name}${search_ext}"
2544 if test -f "$lib"; then
2545 if test "$search_ext" = ".la"; then
2554 if test "$found" != yes; then
2555 # deplib doesn't seem to be a libtool library
2556 if test "$linkmode,$pass" = "prog,link"; then
2557 compile_deplibs
="$deplib $compile_deplibs"
2558 finalize_deplibs
="$deplib $finalize_deplibs"
2560 deplibs
="$deplib $deplibs"
2561 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
2564 else # deplib is a libtool library
2565 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2566 # We need to do some special things here, and not later.
2567 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2568 case " $predeps $postdeps " in
2570 if (${SED} -e '2q' $lib |
2571 grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
2575 */* |
*\\*) .
$lib ;;
2578 for l
in $old_library $library_names; do
2581 if test "X$ll" = "X$old_library" ; then # only static version available
2583 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2584 test "X$ladir" = "X$lib" && ladir
="."
2585 lib
=$ladir/$old_library
2586 if test "$linkmode,$pass" = "prog,link"; then
2587 compile_deplibs
="$deplib $compile_deplibs"
2588 finalize_deplibs
="$deplib $finalize_deplibs"
2590 deplibs
="$deplib $deplibs"
2591 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
2605 deplibs
="$deplib $deplibs"
2606 test "$pass" = conv
&& continue
2607 newdependency_libs
="$deplib $newdependency_libs"
2608 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2611 if test "$pass" = conv
; then
2612 deplibs
="$deplib $deplibs"
2615 if test "$pass" = scan
; then
2616 deplibs
="$deplib $deplibs"
2618 compile_deplibs
="$deplib $compile_deplibs"
2619 finalize_deplibs
="$deplib $finalize_deplibs"
2621 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2624 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2630 if test "$pass" = link
; then
2631 dir
=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2632 # Make sure the xrpath contains only unique directories.
2635 *) xrpath
="$xrpath $dir" ;;
2638 deplibs
="$deplib $deplibs"
2641 *.la
) lib
="$deplib" ;;
2643 if test "$pass" = conv
; then
2644 deplibs
="$deplib $deplibs"
2650 case $deplibs_check_method in
2652 set dummy
$deplibs_check_method
2653 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2654 if eval $echo \"$deplib\" 2>/dev
/null \
2656 |
$EGREP "$match_pattern_regex" > /dev
/null
; then
2664 if test "$valid_a_lib" != yes; then
2666 $echo "*** Warning: Trying to link with static lib archive $deplib."
2667 $echo "*** I have the capability to make that library automatically link in when"
2668 $echo "*** you link to this library. But I can only do this if you have a"
2669 $echo "*** shared version of the library, which you do not appear to have"
2670 $echo "*** because the file extensions .$libext of this argument makes me believe"
2671 $echo "*** that it is just a static archive that I should not used here."
2674 $echo "*** Warning: Linking the shared library $output against the"
2675 $echo "*** static library $deplib is not portable!"
2676 deplibs
="$deplib $deplibs"
2681 if test "$pass" != link
; then
2682 deplibs
="$deplib $deplibs"
2684 compile_deplibs
="$deplib $compile_deplibs"
2685 finalize_deplibs
="$deplib $finalize_deplibs"
2692 if test "$pass" = conv
; then
2693 deplibs
="$deplib $deplibs"
2694 elif test "$linkmode" = prog
; then
2695 if test "$pass" = dlpreopen ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
2696 # If there is no dlopen support or we're linking statically,
2697 # we need to preload.
2698 newdlprefiles
="$newdlprefiles $deplib"
2699 compile_deplibs
="$deplib $compile_deplibs"
2700 finalize_deplibs
="$deplib $finalize_deplibs"
2702 newdlfiles
="$newdlfiles $deplib"
2712 if test "$found" = yes ||
test -f "$lib"; then :
2714 $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
2718 # Check to see that this really is a libtool archive.
2719 if (${SED} -e '2q' $lib |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
2721 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2725 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2726 test "X$ladir" = "X$lib" && ladir
="."
2734 # If the library was installed with an old release of libtool,
2735 # it will not redefine variables installed, or shouldnotlink
2743 */* |
*\\*) .
$lib ;;
2747 if test "$linkmode,$pass" = "lib,link" ||
2748 test "$linkmode,$pass" = "prog,scan" ||
2749 { test "$linkmode" != prog
&& test "$linkmode" != lib
; }; then
2750 test -n "$dlopen" && dlfiles
="$dlfiles $dlopen"
2751 test -n "$dlpreopen" && dlprefiles
="$dlprefiles $dlpreopen"
2754 if test "$pass" = conv
; then
2755 # Only check for convenience libraries
2756 deplibs
="$lib $deplibs"
2757 if test -z "$libdir"; then
2758 if test -z "$old_library"; then
2759 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2762 # It is a libtool convenience library, so add in its objects.
2763 convenience
="$convenience $ladir/$objdir/$old_library"
2764 old_convenience
="$old_convenience $ladir/$objdir/$old_library"
2766 for deplib
in $dependency_libs; do
2767 deplibs
="$deplib $deplibs"
2768 if test "X$duplicate_deps" = "Xyes" ; then
2769 case "$tmp_libs " in
2770 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2773 tmp_libs
="$tmp_libs $deplib"
2775 elif test "$linkmode" != prog
&& test "$linkmode" != lib
; then
2776 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2783 # Get the name of the library we link against.
2785 for l
in $old_library $library_names; do
2788 if test -z "$linklib"; then
2789 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2793 # This library was specified with -dlopen.
2794 if test "$pass" = dlopen
; then
2795 if test -z "$libdir"; then
2796 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2799 if test -z "$dlname" ||
2800 test "$dlopen_support" != yes ||
2801 test "$build_libtool_libs" = no
; then
2802 # If there is no dlname, no dlopen support or we're linking
2803 # statically, we need to preload. We also need to preload any
2804 # dependent libraries so libltdl's deplib preloader doesn't
2805 # bomb out in the load deplibs phase.
2806 dlprefiles
="$dlprefiles $lib $dependency_libs"
2808 newdlfiles
="$newdlfiles $lib"
2813 # We need an absolute path.
2815 [\\/]* |
[A-Za-z
]:[\\/]*) abs_ladir
="$ladir" ;;
2817 abs_ladir
=`cd "$ladir" && pwd`
2818 if test -z "$abs_ladir"; then
2819 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2820 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2825 laname
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2827 # Find the relevant object directory and library name.
2828 if test "X$installed" = Xyes
; then
2829 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2830 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2838 test "X$hardcode_automatic" = Xyes
&& avoidtemprpath
=yes
2840 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2843 # Remove this search path later
2844 notinst_path
="$notinst_path $abs_ladir"
2846 dir
="$ladir/$objdir"
2847 absdir
="$abs_ladir/$objdir"
2848 # Remove this search path later
2849 notinst_path
="$notinst_path $abs_ladir"
2851 fi # $installed = yes
2852 name
=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2854 # This library was specified with -dlpreopen.
2855 if test "$pass" = dlpreopen
; then
2856 if test -z "$libdir"; then
2857 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2860 # Prefer using a static library (so that no silly _DYNAMIC symbols
2861 # are required to link).
2862 if test -n "$old_library"; then
2863 newdlprefiles
="$newdlprefiles $dir/$old_library"
2864 # Otherwise, use the dlname, so that lt_dlopen finds it.
2865 elif test -n "$dlname"; then
2866 newdlprefiles
="$newdlprefiles $dir/$dlname"
2868 newdlprefiles
="$newdlprefiles $dir/$linklib"
2870 fi # $pass = dlpreopen
2872 if test -z "$libdir"; then
2873 # Link the convenience library
2874 if test "$linkmode" = lib
; then
2875 deplibs
="$dir/$old_library $deplibs"
2876 elif test "$linkmode,$pass" = "prog,link"; then
2877 compile_deplibs
="$dir/$old_library $compile_deplibs"
2878 finalize_deplibs
="$dir/$old_library $finalize_deplibs"
2880 deplibs
="$lib $deplibs" # used for prog,scan pass
2886 if test "$linkmode" = prog
&& test "$pass" != link
; then
2887 newlib_search_path
="$newlib_search_path $ladir"
2888 deplibs
="$lib $deplibs"
2891 if test "$link_all_deplibs" != no ||
test -z "$library_names" ||
2892 test "$build_libtool_libs" = no
; then
2897 for deplib
in $dependency_libs; do
2899 -L*) newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2901 # Need to link against all dependency_libs?
2902 if test "$linkalldeplibs" = yes; then
2903 deplibs
="$deplib $deplibs"
2905 # Need to hardcode shared library paths
2906 # or/and link against static libraries
2907 newdependency_libs
="$deplib $newdependency_libs"
2909 if test "X$duplicate_deps" = "Xyes" ; then
2910 case "$tmp_libs " in
2911 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2914 tmp_libs
="$tmp_libs $deplib"
2917 fi # $linkmode = prog...
2919 if test "$linkmode,$pass" = "prog,link"; then
2920 if test -n "$library_names" &&
2921 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
2922 # We need to hardcode the library path
2923 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2924 # Make sure the rpath contains only unique directories.
2925 case "$temp_rpath " in
2928 *) temp_rpath
="$temp_rpath $absdir" ;;
2932 # Hardcode the library path.
2933 # Skip directories that are in the system default run-time
2935 case " $sys_lib_dlsearch_path " in
2938 case "$compile_rpath " in
2940 *) compile_rpath
="$compile_rpath $absdir"
2944 case " $sys_lib_dlsearch_path " in
2947 case "$finalize_rpath " in
2949 *) finalize_rpath
="$finalize_rpath $libdir"
2953 fi # $linkmode,$pass = prog,link...
2955 if test "$alldeplibs" = yes &&
2956 { test "$deplibs_check_method" = pass_all ||
2957 { test "$build_libtool_libs" = yes &&
2958 test -n "$library_names"; }; }; then
2959 # We only need to search for static libraries
2964 link_static
=no
# Whether the deplib will be linked statically
2965 use_static_libs
=$prefer_static_libs
2966 if test "$use_static_libs" = built
&& test "$installed" = yes ; then
2969 if test -n "$library_names" &&
2970 { test "$use_static_libs" = no ||
test -z "$old_library"; }; then
2971 if test "$installed" = no
; then
2972 notinst_deplibs
="$notinst_deplibs $lib"
2975 # This is a shared library
2977 # Warn about portability, can't link against -module's on
2978 # some systems (darwin)
2979 if test "$shouldnotlink" = yes && test "$pass" = link
; then
2981 if test "$linkmode" = prog
; then
2982 $echo "*** Warning: Linking the executable $output against the loadable module"
2984 $echo "*** Warning: Linking the shared library $output against the loadable module"
2986 $echo "*** $linklib is not portable!"
2988 if test "$linkmode" = lib
&&
2989 test "$hardcode_into_libs" = yes; then
2990 # Hardcode the library path.
2991 # Skip directories that are in the system default run-time
2993 case " $sys_lib_dlsearch_path " in
2996 case "$compile_rpath " in
2998 *) compile_rpath
="$compile_rpath $absdir"
3002 case " $sys_lib_dlsearch_path " in
3005 case "$finalize_rpath " in
3007 *) finalize_rpath
="$finalize_rpath $libdir"
3013 if test -n "$old_archive_from_expsyms_cmds"; then
3014 # figure out the soname
3015 set dummy
$library_names
3018 libname
=`eval \\$echo \"$libname_spec\"`
3019 # use dlname if we got it. it's perfectly good, no?
3020 if test -n "$dlname"; then
3022 elif test -n "$soname_spec"; then
3026 major
=`expr $current - $age`
3030 eval soname
=\"$soname_spec\"
3035 # Make a new name for the extract_expsyms_cmds to use
3037 soname
=`$echo $soroot | ${SED} -e 's/^.*\///'`
3038 newlib
="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
3040 # If the library has no export list, then create one now
3041 if test -f "$output_objdir/$soname-def"; then :
3043 $show "extracting exported symbol list from \`$soname'"
3044 save_ifs
="$IFS"; IFS
='~'
3045 cmds
=$extract_expsyms_cmds
3046 for cmd
in $cmds; do
3050 $run eval "$cmd" ||
exit $?
3056 if test -f "$output_objdir/$newlib"; then :; else
3057 $show "generating import library for \`$soname'"
3058 save_ifs
="$IFS"; IFS
='~'
3059 cmds
=$old_archive_from_expsyms_cmds
3060 for cmd
in $cmds; do
3064 $run eval "$cmd" ||
exit $?
3068 # make sure the library variables are pointing to the new library
3071 fi # test -n "$old_archive_from_expsyms_cmds"
3073 if test "$linkmode" = prog ||
test "$mode" != relink
; then
3078 case $hardcode_action in
3079 immediate | unsupported
)
3080 if test "$hardcode_direct" = no
; then
3083 *-*-sco3.2v5.0.
[024]*) add_dir
="-L$dir" ;;
3084 *-*-sysv4*uw2
*) add_dir
="-L$dir" ;;
3085 *-*-sysv5OpenUNIX* |
*-*-sysv5UnixWare7.
[01].
[10]* | \
3086 *-*-unixware7*) add_dir
="-L$dir" ;;
3088 # if the lib is a module then we can not link against
3089 # it, someone is ignoring the new warnings I added
3090 if /usr
/bin
/file -L $add 2> /dev
/null |
3091 $EGREP ": [^:]* bundle" >/dev
/null
; then
3092 $echo "** Warning, lib $linklib is a module, not a shared library"
3093 if test -z "$old_library" ; then
3095 $echo "** And there doesn't seem to be a static archive available"
3096 $echo "** The link will probably fail, sorry"
3098 add
="$dir/$old_library"
3102 elif test "$hardcode_minus_L" = no
; then
3104 *-*-sunos*) add_shlibpath
="$dir" ;;
3108 elif test "$hardcode_shlibpath_var" = no
; then
3109 add_shlibpath
="$dir"
3116 if test "$hardcode_direct" = yes; then
3118 elif test "$hardcode_minus_L" = yes; then
3120 # Try looking first in the location we're being installed to.
3121 if test -n "$inst_prefix_dir"; then
3124 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
3129 elif test "$hardcode_shlibpath_var" = yes; then
3130 add_shlibpath
="$dir"
3139 if test "$lib_linked" != yes; then
3140 $echo "$modename: configuration error: unsupported hardcode properties"
3144 if test -n "$add_shlibpath"; then
3145 case :$compile_shlibpath: in
3146 *":$add_shlibpath:"*) ;;
3147 *) compile_shlibpath
="$compile_shlibpath$add_shlibpath:" ;;
3150 if test "$linkmode" = prog
; then
3151 test -n "$add_dir" && compile_deplibs
="$add_dir $compile_deplibs"
3152 test -n "$add" && compile_deplibs
="$add $compile_deplibs"
3154 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
3155 test -n "$add" && deplibs
="$add $deplibs"
3156 if test "$hardcode_direct" != yes && \
3157 test "$hardcode_minus_L" != yes && \
3158 test "$hardcode_shlibpath_var" = yes; then
3159 case :$finalize_shlibpath: in
3161 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
3167 if test "$linkmode" = prog ||
test "$mode" = relink
; then
3171 # Finalize command for both is simple: just hardcode it.
3172 if test "$hardcode_direct" = yes; then
3173 add
="$libdir/$linklib"
3174 elif test "$hardcode_minus_L" = yes; then
3177 elif test "$hardcode_shlibpath_var" = yes; then
3178 case :$finalize_shlibpath: in
3180 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
3183 elif test "$hardcode_automatic" = yes; then
3184 if test -n "$inst_prefix_dir" &&
3185 test -f "$inst_prefix_dir$libdir/$linklib" ; then
3186 add
="$inst_prefix_dir$libdir/$linklib"
3188 add
="$libdir/$linklib"
3191 # We cannot seem to hardcode it, guess we'll fake it.
3193 # Try looking first in the location we're being installed to.
3194 if test -n "$inst_prefix_dir"; then
3197 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
3204 if test "$linkmode" = prog
; then
3205 test -n "$add_dir" && finalize_deplibs
="$add_dir $finalize_deplibs"
3206 test -n "$add" && finalize_deplibs
="$add $finalize_deplibs"
3208 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
3209 test -n "$add" && deplibs
="$add $deplibs"
3212 elif test "$linkmode" = prog
; then
3213 # Here we assume that one of hardcode_direct or hardcode_minus_L
3214 # is not unsupported. This is valid on all known static and
3216 if test "$hardcode_direct" != unsupported
; then
3217 test -n "$old_library" && linklib
="$old_library"
3218 compile_deplibs
="$dir/$linklib $compile_deplibs"
3219 finalize_deplibs
="$dir/$linklib $finalize_deplibs"
3221 compile_deplibs
="-l$name -L$dir $compile_deplibs"
3222 finalize_deplibs
="-l$name -L$dir $finalize_deplibs"
3224 elif test "$build_libtool_libs" = yes; then
3225 # Not a shared library
3226 if test "$deplibs_check_method" != pass_all
; then
3227 # We're trying link a shared library against a static one
3228 # but the system doesn't support it.
3230 # Just print a warning and add the library to dependency_libs so
3231 # that the program can be linked against the static library.
3233 $echo "*** Warning: This system can not link to static lib archive $lib."
3234 $echo "*** I have the capability to make that library automatically link in when"
3235 $echo "*** you link to this library. But I can only do this if you have a"
3236 $echo "*** shared version of the library, which you do not appear to have."
3237 if test "$module" = yes; then
3238 $echo "*** But as you try to build a module library, libtool will still create "
3239 $echo "*** a static module, that should work as long as the dlopening application"
3240 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
3241 if test -z "$global_symbol_pipe"; then
3243 $echo "*** However, this would only work if libtool was able to extract symbol"
3244 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3245 $echo "*** not find such a program. So, this module is probably useless."
3246 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3248 if test "$build_old_libs" = no
; then
3249 build_libtool_libs
=module
3252 build_libtool_libs
=no
3256 deplibs
="$dir/$old_library $deplibs"
3259 fi # link shared/static library?
3261 if test "$linkmode" = lib
; then
3262 if test -n "$dependency_libs" &&
3263 { test "$hardcode_into_libs" != yes ||
3264 test "$build_old_libs" = yes ||
3265 test "$link_static" = yes; }; then
3266 # Extract -R from dependency_libs
3268 for libdir
in $dependency_libs; do
3270 -R*) temp_xrpath
=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
3272 *" $temp_xrpath "*) ;;
3273 *) xrpath
="$xrpath $temp_xrpath";;
3275 *) temp_deplibs
="$temp_deplibs $libdir";;
3278 dependency_libs
="$temp_deplibs"
3281 newlib_search_path
="$newlib_search_path $absdir"
3282 # Link against this library
3283 test "$link_static" = no
&& newdependency_libs
="$abs_ladir/$laname $newdependency_libs"
3284 # ... and its dependency_libs
3286 for deplib
in $dependency_libs; do
3287 newdependency_libs
="$deplib $newdependency_libs"
3288 if test "X$duplicate_deps" = "Xyes" ; then
3289 case "$tmp_libs " in
3290 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
3293 tmp_libs
="$tmp_libs $deplib"
3296 if test "$link_all_deplibs" != no
; then
3297 # Add the search paths of all dependency libraries
3298 for deplib
in $dependency_libs; do
3300 -L*) path
="$deplib" ;;
3302 dir
=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
3303 test "X$dir" = "X$deplib" && dir
="."
3304 # We need an absolute path.
3306 [\\/]* |
[A-Za-z
]:[\\/]*) absdir
="$dir" ;;
3308 absdir
=`cd "$dir" && pwd`
3309 if test -z "$absdir"; then
3310 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
3315 if grep "^installed=no" $deplib > /dev
/null
; then
3316 path
="$absdir/$objdir"
3318 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3319 if test -z "$libdir"; then
3320 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3323 if test "$absdir" != "$libdir"; then
3324 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
3331 # we do not want to link against static libs,
3332 # but need to link against shared
3333 eval deplibrary_names
=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
3334 if test -n "$deplibrary_names" ; then
3335 for tmp
in $deplibrary_names ; do
3338 if test -f "$path/$depdepl" ; then
3339 depdepl
="$path/$depdepl"
3341 # do not add paths which are already there
3342 case " $newlib_search_path " in
3344 *) newlib_search_path
="$newlib_search_path $path";;
3357 # Again, we only want to link against shared libraries
3358 eval tmp_libs
=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
3359 for tmp
in $newlib_search_path ; do
3360 if test -f "$tmp/lib$tmp_libs.dylib" ; then
3361 eval depdepl
="$tmp/lib$tmp_libs.dylib"
3372 case " $deplibs " in
3374 *) deplibs
="$path $deplibs" ;;
3376 case " $deplibs " in
3378 *) deplibs
="$depdepl $deplibs" ;;
3381 fi # link_all_deplibs != no
3383 done # for deplib in $libs
3384 dependency_libs
="$newdependency_libs"
3385 if test "$pass" = dlpreopen
; then
3386 # Link the dlpreopened libraries before other libraries
3387 for deplib
in $save_deplibs; do
3388 deplibs
="$deplib $deplibs"
3391 if test "$pass" != dlopen
; then
3392 if test "$pass" != conv
; then
3393 # Make sure lib_search_path contains only unique directories.
3395 for dir
in $newlib_search_path; do
3396 case "$lib_search_path " in
3398 *) lib_search_path
="$lib_search_path $dir" ;;
3404 if test "$linkmode,$pass" != "prog,link"; then
3407 vars
="compile_deplibs finalize_deplibs"
3409 for var
in $vars dependency_libs
; do
3410 # Add libraries to $var in reverse order
3411 eval tmp_libs
=\"\$
$var\"
3413 for deplib
in $tmp_libs; do
3414 # FIXME: Pedantically, this is the right thing to do, so
3415 # that some nasty dependency loop isn't accidentally
3417 #new_libs="$deplib $new_libs"
3418 # Pragmatically, this seems to cause very few problems in
3421 -L*) new_libs
="$deplib $new_libs" ;;
3424 # And here is the reason: when a library appears more
3425 # than once as an explicit dependence of a library, or
3426 # is implicitly linked in more than once by the
3427 # compiler, it is considered special, and multiple
3428 # occurrences thereof are not removed. Compare this
3429 # with having the same library being listed as a
3430 # dependency of multiple other libraries: in this case,
3431 # we know (pedantically, we assume) the library does not
3432 # need to be listed more than once, so we keep only the
3433 # last copy. This is not always right, but it is rare
3434 # enough that we require users that really mean to play
3435 # such unportable linking tricks to link the library
3436 # using -Wl,-lname, so that libtool does not consider it
3437 # for duplicate removal.
3438 case " $specialdeplibs " in
3439 *" $deplib "*) new_libs
="$deplib $new_libs" ;;
3441 case " $new_libs " in
3443 *) new_libs
="$deplib $new_libs" ;;
3451 for deplib
in $new_libs; do
3454 case " $tmp_libs " in
3456 *) tmp_libs
="$tmp_libs $deplib" ;;
3459 *) tmp_libs
="$tmp_libs $deplib" ;;
3462 eval $var=\"$tmp_libs\"
3465 # Last step: remove runtime libs from dependency_libs
3466 # (they stay in deplibs)
3468 for i
in $dependency_libs ; do
3469 case " $predeps $postdeps $compiler_lib_search_path " in
3474 if test -n "$i" ; then
3475 tmp_libs
="$tmp_libs $i"
3478 dependency_libs
=$tmp_libs
3480 if test "$linkmode" = prog
; then
3481 dlfiles
="$newdlfiles"
3482 dlprefiles
="$newdlprefiles"
3487 if test -n "$deplibs"; then
3488 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
3491 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3492 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3495 if test -n "$rpath"; then
3496 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3499 if test -n "$xrpath"; then
3500 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3503 if test -n "$vinfo"; then
3504 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3507 if test -n "$release"; then
3508 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3511 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
3512 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3515 # Now set the variables for building old libraries.
3516 build_libtool_libs
=no
3518 objs
="$objs$old_deplibs"
3522 # Make sure we only generate libraries of the form `libNAME.la'.
3525 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3526 eval shared_ext
=\"$shrext_cmds\"
3527 eval libname
=\"$libname_spec\"
3530 if test "$module" = no
; then
3531 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3535 if test "$need_lib_prefix" != no
; then
3536 # Add the "lib" prefix for modules if required
3537 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3538 eval shared_ext
=\"$shrext_cmds\"
3539 eval libname
=\"$libname_spec\"
3541 libname
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3546 if test -n "$objs"; then
3547 if test "$deplibs_check_method" != pass_all
; then
3548 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3552 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3553 $echo "*** objects $objs is not portable!"
3554 libobjs
="$libobjs $objs"
3558 if test "$dlself" != no
; then
3559 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3563 if test "$#" -gt 2; then
3564 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3569 if test -z "$rpath"; then
3570 if test "$build_libtool_libs" = yes; then
3571 # Building a libtool convenience library.
3572 # Some compilers have problems with a `.al' extension so
3573 # convenience libraries should have the same extension an
3574 # archive normally would.
3575 oldlibs
="$output_objdir/$libname.$libext $oldlibs"
3576 build_libtool_libs
=convenience
3580 if test -n "$vinfo"; then
3581 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3584 if test -n "$release"; then
3585 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3589 # Parse the version information argument.
3590 save_ifs
="$IFS"; IFS
=':'
3591 set dummy
$vinfo 0 0 0
3594 if test -n "$8"; then
3595 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3600 # convert absolute version numbers to libtool ages
3601 # this retains compatibility with .la files and attempts
3602 # to make the code below a bit more comprehensible
3604 case $vinfo_number in
3608 number_revision
="$4"
3610 # There are really only two kinds -- those that
3611 # use the current revision as the major version
3612 # and those that subtract age and use age as
3613 # a minor version. But, then there is irix
3614 # which has an extra 1 added just for fun
3616 case $version_type in
3617 darwin|linux|osf|windows
)
3618 current
=`expr $number_major + $number_minor`
3620 revision
="$number_revision"
3622 freebsd-aout|freebsd-elf|sunos
)
3623 current
="$number_major"
3624 revision
="$number_minor"
3628 current
=`expr $number_major + $number_minor - 1`
3630 revision
="$number_minor"
3641 # Check that each of the things are valid numbers.
3643 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]) ;;
3645 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3646 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3652 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]) ;;
3654 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3655 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3661 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]) ;;
3663 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3664 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3669 if test "$age" -gt "$current"; then
3670 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3671 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3675 # Calculate the version variables.
3679 case $version_type in
3683 # Like Linux, but with the current version available in
3684 # verstring for coding it into the library header
3685 major
=.
`expr $current - $age`
3686 versuffix
="$major.$age.$revision"
3687 # Darwin ld doesn't like 0 for these options...
3688 minor_current
=`expr $current + 1`
3689 verstring
="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3694 versuffix
=".$current.$revision";
3699 versuffix
=".$current";
3703 major
=`expr $current - $age + 1`
3705 case $version_type in
3706 nonstopux
) verstring_prefix
=nonstopux
;;
3707 *) verstring_prefix
=sgi
;;
3709 verstring
="$verstring_prefix$major.$revision"
3711 # Add in all the interfaces that we are compatible with.
3713 while test "$loop" -ne 0; do
3714 iface
=`expr $revision - $loop`
3715 loop
=`expr $loop - 1`
3716 verstring
="$verstring_prefix$major.$iface:$verstring"
3719 # Before this point, $major must not contain `.'.
3721 versuffix
="$major.$revision"
3725 major
=.
`expr $current - $age`
3726 versuffix
="$major.$age.$revision"
3730 major
=.
`expr $current - $age`
3731 versuffix
=".$current.$age.$revision"
3732 verstring
="$current.$age.$revision"
3734 # Add in all the interfaces that we are compatible with.
3736 while test "$loop" -ne 0; do
3737 iface
=`expr $current - $loop`
3738 loop
=`expr $loop - 1`
3739 verstring
="$verstring:${iface}.0"
3742 # Make executables depend on our current version.
3743 verstring
="$verstring:${current}.0"
3748 versuffix
=".$current.$revision"
3752 # Use '-' rather than '.', since we only want one
3753 # extension on DOS 8.3 filesystems.
3754 major
=`expr $current - $age`
3759 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3760 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3765 # Clear the version info if we defaulted, and they specified a release.
3766 if test -z "$vinfo" && test -n "$release"; then
3768 case $version_type in
3770 # we can't check for "0.0" in archive_cmds due to quoting
3771 # problems, so we reset it completely
3778 if test "$need_version" = no
; then
3785 # Remove version info from name if versioning should be avoided
3786 if test "$avoid_version" = yes && test "$need_version" = no
; then
3792 # Check to see if the archive will have undefined symbols.
3793 if test "$allow_undefined" = yes; then
3794 if test "$allow_undefined_flag" = unsupported
; then
3795 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3796 build_libtool_libs
=no
3800 # Don't allow undefined symbols.
3801 allow_undefined_flag
="$no_undefined_flag"
3805 if test "$mode" != relink
; then
3806 # Remove our outputs, but don't remove object files since they
3807 # may have been created when compiling PIC objects.
3809 tempremovelist
=`$echo "$output_objdir/*"`
3810 for p
in $tempremovelist; do
3814 $output_objdir/$outputname |
$output_objdir/$libname.
* |
$output_objdir/${libname}${release}.
*)
3815 if test "X$precious_files_regex" != "X"; then
3816 if echo $p |
$EGREP -e "$precious_files_regex" >/dev
/null
2>&1
3821 removelist
="$removelist $p"
3826 if test -n "$removelist"; then
3827 $show "${rm}r $removelist"
3828 $run ${rm}r
$removelist
3832 # Now set the variables for building old libraries.
3833 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience
; then
3834 oldlibs
="$oldlibs $output_objdir/$libname.$libext"
3836 # Transform .lo files to .o files.
3837 oldobjs
="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3840 # Eliminate all temporary directories.
3841 for path
in $notinst_path; do
3842 lib_search_path
=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
3843 deplibs
=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
3844 dependency_libs
=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
3847 if test -n "$xrpath"; then
3848 # If the user specified any rpath flags, then add them.
3850 for libdir
in $xrpath; do
3851 temp_xrpath
="$temp_xrpath -R$libdir"
3852 case "$finalize_rpath " in
3854 *) finalize_rpath
="$finalize_rpath $libdir" ;;
3857 if test "$hardcode_into_libs" != yes ||
test "$build_old_libs" = yes; then
3858 dependency_libs
="$temp_xrpath $dependency_libs"
3862 # Make sure dlfiles contains only unique files that won't be dlpreopened
3863 old_dlfiles
="$dlfiles"
3865 for lib
in $old_dlfiles; do
3866 case " $dlprefiles $dlfiles " in
3868 *) dlfiles
="$dlfiles $lib" ;;
3872 # Make sure dlprefiles contains only unique files
3873 old_dlprefiles
="$dlprefiles"
3875 for lib
in $old_dlprefiles; do
3876 case "$dlprefiles " in
3878 *) dlprefiles
="$dlprefiles $lib" ;;
3882 if test "$build_libtool_libs" = yes; then
3883 if test -n "$rpath"; then
3885 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2* |
*-*-beos*)
3886 # these systems don't actually have a c library (as such)!
3888 *-*-rhapsody* |
*-*-darwin1.
[012])
3889 # Rhapsody C library is in the System framework
3890 deplibs
="$deplibs -framework System"
3893 # Don't link with libc until the a.out ld.so is fixed.
3895 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
3896 # Do not include libc due to us having libc/libc_r.
3898 *-*-sco3.2v5
* |
*-*-sco5v6*)
3899 # Causes problems with __ctype
3901 *-*-sysv4.2uw2
* |
*-*-sysv5* |
*-*-unixware* |
*-*-OpenUNIX*)
3902 # Compiler inserts libc in the correct place for threads to work
3905 # Add libc to deplibs on all other systems if necessary.
3906 if test "$build_libtool_need_lc" = "yes"; then
3907 deplibs
="$deplibs -lc"
3913 # Transform deplibs into only deplibs that can be linked in shared.
3915 libname_save
=$libname
3916 release_save
=$release
3917 versuffix_save
=$versuffix
3919 # I'm not sure if I'm treating the release correctly. I think
3920 # release should show up in the -l (ie -lgmp5) so we don't want to
3921 # add it in twice. Is that correct?
3927 case $deplibs_check_method in
3929 # Don't check for shared/static. Everything works.
3930 # This might be a little naive. We might want to check
3931 # whether the library exists or not. But this is on
3932 # osf3 & osf4 and I'm not really sure... Just
3933 # implementing what was already the behavior.
3937 # This code stresses the "libraries are programs" paradigm to its
3938 # limits. Maybe even breaks it. We compile a program, linking it
3939 # against the deplibs as a proxy for the library. Then we can check
3940 # whether they linked in statically or dynamically with ldd.
3942 cat > conftest.c
<<EOF
3943 int main() { return 0; }
3946 $LTCC $LTCFLAGS -o conftest conftest.c
$deplibs
3947 if test "$?" -eq 0 ; then
3948 ldd_output
=`ldd conftest`
3949 for i
in $deplibs; do
3950 name
=`expr $i : '-l\(.*\)'`
3951 # If $name is empty we are operating on a -L argument.
3952 if test "$name" != "" && test "$name" -ne "0"; then
3953 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3954 case " $predeps $postdeps " in
3956 newdeplibs
="$newdeplibs $i"
3961 if test -n "$i" ; then
3962 libname
=`eval \\$echo \"$libname_spec\"`
3963 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
3964 set dummy
$deplib_matches
3966 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3967 newdeplibs
="$newdeplibs $i"
3971 $echo "*** Warning: dynamic linker does not accept needed library $i."
3972 $echo "*** I have the capability to make that library automatically link in when"
3973 $echo "*** you link to this library. But I can only do this if you have a"
3974 $echo "*** shared version of the library, which I believe you do not have"
3975 $echo "*** because a test_compile did reveal that the linker did not use it for"
3976 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3980 newdeplibs
="$newdeplibs $i"
3984 # Error occurred in the first compile. Let's try to salvage
3985 # the situation: Compile a separate program for each library.
3986 for i
in $deplibs; do
3987 name
=`expr $i : '-l\(.*\)'`
3988 # If $name is empty we are operating on a -L argument.
3989 if test "$name" != "" && test "$name" != "0"; then
3991 $LTCC $LTCFLAGS -o conftest conftest.c
$i
3993 if test "$?" -eq 0 ; then
3994 ldd_output
=`ldd conftest`
3995 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3996 case " $predeps $postdeps " in
3998 newdeplibs
="$newdeplibs $i"
4003 if test -n "$i" ; then
4004 libname
=`eval \\$echo \"$libname_spec\"`
4005 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
4006 set dummy
$deplib_matches
4008 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
4009 newdeplibs
="$newdeplibs $i"
4013 $echo "*** Warning: dynamic linker does not accept needed library $i."
4014 $echo "*** I have the capability to make that library automatically link in when"
4015 $echo "*** you link to this library. But I can only do this if you have a"
4016 $echo "*** shared version of the library, which you do not appear to have"
4017 $echo "*** because a test_compile did reveal that the linker did not use this one"
4018 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
4024 $echo "*** Warning! Library $i is needed by this library but I was not able to"
4025 $echo "*** make it link in! You will probably need to install it or some"
4026 $echo "*** library that it depends on before this library will be fully"
4027 $echo "*** functional. Installing it before continuing would be even better."
4030 newdeplibs
="$newdeplibs $i"
4036 set dummy
$deplibs_check_method
4037 file_magic_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
4038 for a_deplib
in $deplibs; do
4039 name
=`expr $a_deplib : '-l\(.*\)'`
4040 # If $name is empty we are operating on a -L argument.
4041 if test "$name" != "" && test "$name" != "0"; then
4042 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4043 case " $predeps $postdeps " in
4045 newdeplibs
="$newdeplibs $a_deplib"
4050 if test -n "$a_deplib" ; then
4051 libname
=`eval \\$echo \"$libname_spec\"`
4052 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
4053 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
4054 for potent_lib
in $potential_libs; do
4055 # Follow soft links.
4056 if ls -lLd "$potent_lib" 2>/dev
/null \
4057 |
grep " -> " >/dev
/null
; then
4060 # The statement above tries to avoid entering an
4061 # endless loop below, in case of cyclic links.
4062 # We might still enter an endless loop, since a link
4063 # loop can be closed while we follow links,
4065 potlib
="$potent_lib"
4066 while test -h "$potlib" 2>/dev
/null
; do
4067 potliblink
=`ls -ld $potlib | ${SED} 's/.* -> //'`
4069 [\\/]* |
[A-Za-z
]:[\\/]*) potlib
="$potliblink";;
4070 *) potlib
=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
4073 # It is ok to link against an archive when
4074 # building a shared library.
4075 if $AR -t $potlib > /dev
/null
2>&1; then
4076 newdeplibs
="$newdeplibs $a_deplib"
4080 if eval $file_magic_cmd \"\
$potlib\" 2>/dev
/null \
4082 |
$EGREP "$file_magic_regex" > /dev
/null
; then
4083 newdeplibs
="$newdeplibs $a_deplib"
4090 if test -n "$a_deplib" ; then
4093 $echo "*** Warning: linker path does not have real file for library $a_deplib."
4094 $echo "*** I have the capability to make that library automatically link in when"
4095 $echo "*** you link to this library. But I can only do this if you have a"
4096 $echo "*** shared version of the library, which you do not appear to have"
4097 $echo "*** because I did check the linker path looking for a file starting"
4098 if test -z "$potlib" ; then
4099 $echo "*** with $libname but no candidates were found. (...for file magic test)"
4101 $echo "*** with $libname and none of the candidates passed a file format test"
4102 $echo "*** using a file magic. Last file checked: $potlib"
4106 # Add a -L argument.
4107 newdeplibs
="$newdeplibs $a_deplib"
4109 done # Gone through all deplibs.
4112 set dummy
$deplibs_check_method
4113 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
4114 for a_deplib
in $deplibs; do
4115 name
=`expr $a_deplib : '-l\(.*\)'`
4116 # If $name is empty we are operating on a -L argument.
4117 if test -n "$name" && test "$name" != "0"; then
4118 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4119 case " $predeps $postdeps " in
4121 newdeplibs
="$newdeplibs $a_deplib"
4126 if test -n "$a_deplib" ; then
4127 libname
=`eval \\$echo \"$libname_spec\"`
4128 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
4129 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
4130 for potent_lib
in $potential_libs; do
4131 potlib
="$potent_lib" # see symlink-check above in file_magic test
4132 if eval $echo \"$potent_lib\" 2>/dev
/null \
4134 |
$EGREP "$match_pattern_regex" > /dev
/null
; then
4135 newdeplibs
="$newdeplibs $a_deplib"
4142 if test -n "$a_deplib" ; then
4145 $echo "*** Warning: linker path does not have real file for library $a_deplib."
4146 $echo "*** I have the capability to make that library automatically link in when"
4147 $echo "*** you link to this library. But I can only do this if you have a"
4148 $echo "*** shared version of the library, which you do not appear to have"
4149 $echo "*** because I did check the linker path looking for a file starting"
4150 if test -z "$potlib" ; then
4151 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
4153 $echo "*** with $libname and none of the candidates passed a file format test"
4154 $echo "*** using a regex pattern. Last file checked: $potlib"
4158 # Add a -L argument.
4159 newdeplibs
="$newdeplibs $a_deplib"
4161 done # Gone through all deplibs.
4165 tmp_deplibs
=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
4166 -e 's/ -[LR][^ ]*//g'`
4167 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4168 for i
in $predeps $postdeps ; do
4169 # can't use Xsed below, because $i might contain '/'
4170 tmp_deplibs
=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
4173 if $echo "X $tmp_deplibs" |
$Xsed -e 's/[ ]//g' \
4174 |
grep .
>/dev
/null
; then
4176 if test "X$deplibs_check_method" = "Xnone"; then
4177 $echo "*** Warning: inter-library dependencies are not supported in this platform."
4179 $echo "*** Warning: inter-library dependencies are not known to be supported."
4181 $echo "*** All declared inter-library dependencies are being dropped."
4186 versuffix
=$versuffix_save
4188 release
=$release_save
4189 libname
=$libname_save
4193 *-*-rhapsody* |
*-*-darwin1.
[012])
4194 # On Rhapsody replace the C library is the System framework
4195 newdeplibs
=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
4199 if test "$droppeddeps" = yes; then
4200 if test "$module" = yes; then
4202 $echo "*** Warning: libtool could not satisfy all declared inter-library"
4203 $echo "*** dependencies of module $libname. Therefore, libtool will create"
4204 $echo "*** a static module, that should work as long as the dlopening"
4205 $echo "*** application is linked with the -dlopen flag."
4206 if test -z "$global_symbol_pipe"; then
4208 $echo "*** However, this would only work if libtool was able to extract symbol"
4209 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
4210 $echo "*** not find such a program. So, this module is probably useless."
4211 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
4213 if test "$build_old_libs" = no
; then
4214 oldlibs
="$output_objdir/$libname.$libext"
4215 build_libtool_libs
=module
4218 build_libtool_libs
=no
4221 $echo "*** The inter-library dependencies that have been dropped here will be"
4222 $echo "*** automatically added whenever a program is linked with this library"
4223 $echo "*** or is declared to -dlopen it."
4225 if test "$allow_undefined" = no
; then
4227 $echo "*** Since this library must not contain undefined symbols,"
4228 $echo "*** because either the platform does not support them or"
4229 $echo "*** it was explicitly requested with -no-undefined,"
4230 $echo "*** libtool will only create a static version of it."
4231 if test "$build_old_libs" = no
; then
4232 oldlibs
="$output_objdir/$libname.$libext"
4233 build_libtool_libs
=module
4236 build_libtool_libs
=no
4241 # Done checking deplibs!
4246 # move library search paths that coincide with paths to not yet
4247 # installed libraries to the beginning of the library search list
4249 for path
in $notinst_path; do
4250 case " $new_libs " in
4251 *" -L$path/$objdir "*) ;;
4253 case " $deplibs " in
4254 *" -L$path/$objdir "*)
4255 new_libs
="$new_libs -L$path/$objdir" ;;
4260 for deplib
in $deplibs; do
4263 case " $new_libs " in
4265 *) new_libs
="$new_libs $deplib" ;;
4268 *) new_libs
="$new_libs $deplib" ;;
4274 # All the library-specific variables (install_libdir is set above).
4279 # Test again, we may have decided not to build it any more
4280 if test "$build_libtool_libs" = yes; then
4281 if test "$hardcode_into_libs" = yes; then
4282 # Hardcode the library paths
4285 rpath
="$finalize_rpath"
4286 test "$mode" != relink
&& rpath
="$compile_rpath$rpath"
4287 for libdir
in $rpath; do
4288 if test -n "$hardcode_libdir_flag_spec"; then
4289 if test -n "$hardcode_libdir_separator"; then
4290 if test -z "$hardcode_libdirs"; then
4291 hardcode_libdirs
="$libdir"
4293 # Just accumulate the unique libdirs.
4294 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4295 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4298 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4303 eval flag
=\"$hardcode_libdir_flag_spec\"
4304 dep_rpath
="$dep_rpath $flag"
4306 elif test -n "$runpath_var"; then
4307 case "$perm_rpath " in
4309 *) perm_rpath
="$perm_rpath $libdir" ;;
4313 # Substitute the hardcoded libdirs into the rpath.
4314 if test -n "$hardcode_libdir_separator" &&
4315 test -n "$hardcode_libdirs"; then
4316 libdir
="$hardcode_libdirs"
4317 if test -n "$hardcode_libdir_flag_spec_ld"; then
4318 eval dep_rpath
=\"$hardcode_libdir_flag_spec_ld\"
4320 eval dep_rpath
=\"$hardcode_libdir_flag_spec\"
4323 if test -n "$runpath_var" && test -n "$perm_rpath"; then
4324 # We should set the runpath_var.
4326 for dir
in $perm_rpath; do
4329 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
4331 test -n "$dep_rpath" && deplibs
="$dep_rpath $deplibs"
4334 shlibpath
="$finalize_shlibpath"
4335 test "$mode" != relink
&& shlibpath
="$compile_shlibpath$shlibpath"
4336 if test -n "$shlibpath"; then
4337 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
4340 # Get the real and link names of the library.
4341 eval shared_ext
=\"$shrext_cmds\"
4342 eval library_names
=\"$library_names_spec\"
4343 set dummy
$library_names
4347 if test -n "$soname_spec"; then
4348 eval soname
=\"$soname_spec\"
4352 if test -z "$dlname"; then
4356 lib
="$output_objdir/$realname"
4360 linknames
="$linknames $link"
4363 # Use standard objects if they are pic
4364 test -z "$pic_flag" && libobjs
=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4366 # Prepare the list of exported symbols
4367 if test -z "$export_symbols"; then
4368 if test "$always_export_symbols" = yes ||
test -n "$export_symbols_regex"; then
4369 $show "generating symbol list for \`$libname.la'"
4370 export_symbols
="$output_objdir/$libname.exp"
4371 $run $rm $export_symbols
4372 cmds
=$export_symbols_cmds
4373 save_ifs
="$IFS"; IFS
='~'
4374 for cmd
in $cmds; do
4377 if len
=`expr "X$cmd" : ".*"` &&
4378 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
4380 $run eval "$cmd" ||
exit $?
4381 skipped_export
=false
4383 # The command line is too long to execute in one step.
4384 $show "using reloadable object file for export list..."
4386 # Break out early, otherwise skipped_export may be
4387 # set to false by a later but shorter cmd.
4392 if test -n "$export_symbols_regex"; then
4393 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
4394 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
4395 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
4396 $run eval '$mv "${export_symbols}T" "$export_symbols"'
4401 if test -n "$export_symbols" && test -n "$include_expsyms"; then
4402 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
4406 for test_deplib
in $deplibs; do
4407 case " $convenience " in
4408 *" $test_deplib "*) ;;
4410 tmp_deplibs
="$tmp_deplibs $test_deplib"
4414 deplibs
="$tmp_deplibs"
4416 if test -n "$convenience"; then
4417 if test -n "$whole_archive_flag_spec"; then
4418 save_libobjs
=$libobjs
4419 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
4421 gentop
="$output_objdir/${outputname}x"
4422 generated
="$generated $gentop"
4424 func_extract_archives
$gentop $convenience
4425 libobjs
="$libobjs $func_extract_archives_result"
4429 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
4430 eval flag
=\"$thread_safe_flag_spec\"
4431 linker_flags
="$linker_flags $flag"
4434 # Make a backup of the uninstalled library when relinking
4435 if test "$mode" = relink
; then
4436 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' ||
exit $?
4439 # Do each of the archive commands.
4440 if test "$module" = yes && test -n "$module_cmds" ; then
4441 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4442 eval test_cmds
=\"$module_expsym_cmds\"
4443 cmds
=$module_expsym_cmds
4445 eval test_cmds
=\"$module_cmds\"
4449 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4450 eval test_cmds
=\"$archive_expsym_cmds\"
4451 cmds
=$archive_expsym_cmds
4453 eval test_cmds
=\"$archive_cmds\"
4458 if test "X$skipped_export" != "X:" &&
4459 len
=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4460 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
4463 # The command line is too long to link in one step, link piecewise.
4464 $echo "creating reloadable object files..."
4466 # Save the value of $output and $libobjs because we want to
4467 # use them later. If we have whole_archive_flag_spec, we
4468 # want to use save_libobjs as it was before
4469 # whole_archive_flag_spec was expanded, because we can't
4470 # assume the linker understands whole_archive_flag_spec.
4471 # This may have to be revisited, in case too many
4472 # convenience libraries get linked in and end up exceeding
4474 if test -z "$convenience" ||
test -z "$whole_archive_flag_spec"; then
4475 save_libobjs
=$libobjs
4478 output_la
=`$echo "X$output" | $Xsed -e "$basename"`
4480 # Clear the reloadable object creation command queue and
4481 # initialize k to one.
4488 output
=$output_objdir/$output_la-${k}.
$objext
4489 # Loop over the list of objects to be linked.
4490 for obj
in $save_libobjs
4492 eval test_cmds
=\"$reload_cmds $objlist $last_robj\"
4493 if test "X$objlist" = X ||
4494 { len
=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4495 test "$len" -le "$max_cmd_len"; }; then
4496 objlist
="$objlist $obj"
4498 # The command $test_cmds is almost too long, add a
4499 # command to the queue.
4500 if test "$k" -eq 1 ; then
4501 # The first file doesn't have a previous command to add.
4502 eval concat_cmds
=\"$reload_cmds $objlist $last_robj\"
4504 # All subsequent reloadable object files will link in
4505 # the last one created.
4506 eval concat_cmds
=\"\
$concat_cmds~
$reload_cmds $objlist $last_robj\"
4508 last_robj
=$output_objdir/$output_la-${k}.
$objext
4510 output
=$output_objdir/$output_la-${k}.
$objext
4515 # Handle the remaining objects by creating one last
4516 # reloadable object file. All subsequent reloadable object
4517 # files will link in the last one created.
4518 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
4519 eval concat_cmds
=\"\
${concat_cmds}$reload_cmds $objlist $last_robj\"
4521 if ${skipped_export-false}; then
4522 $show "generating symbol list for \`$libname.la'"
4523 export_symbols
="$output_objdir/$libname.exp"
4524 $run $rm $export_symbols
4526 # Append the command to create the export file.
4527 eval concat_cmds
=\"\
$concat_cmds~
$export_symbols_cmds\"
4530 # Set up a command to remove the reloadable object files
4531 # after they are used.
4533 while test "$i" -lt "$k"
4536 delfiles
="$delfiles $output_objdir/$output_la-${i}.$objext"
4539 $echo "creating a temporary reloadable object file: $output"
4541 # Loop through the commands generated above and execute them.
4542 save_ifs
="$IFS"; IFS
='~'
4543 for cmd
in $concat_cmds; do
4546 $run eval "$cmd" ||
exit $?
4551 # Restore the value of output.
4554 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4555 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
4557 # Expand the library linking commands again to reset the
4558 # value of $libobjs for piecewise linking.
4560 # Do each of the archive commands.
4561 if test "$module" = yes && test -n "$module_cmds" ; then
4562 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4563 cmds
=$module_expsym_cmds
4568 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4569 cmds
=$archive_expsym_cmds
4575 # Append the command to remove the reloadable object files
4576 # to the just-reset $cmds.
4577 eval cmds
=\"\
$cmds~\
$rm $delfiles\"
4579 save_ifs
="$IFS"; IFS
='~'
4580 for cmd
in $cmds; do
4584 $run eval "$cmd" ||
{
4587 # Restore the uninstalled library and exit
4588 if test "$mode" = relink
; then
4589 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
4597 # Restore the uninstalled library and exit
4598 if test "$mode" = relink
; then
4599 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' ||
exit $?
4601 if test -n "$convenience"; then
4602 if test -z "$whole_archive_flag_spec"; then
4603 $show "${rm}r $gentop"
4604 $run ${rm}r
"$gentop"
4611 # Create links to the real library.
4612 for linkname
in $linknames; do
4613 if test "$realname" != "$linkname"; then
4614 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4615 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' ||
exit $?
4619 # If -module or -export-dynamic was specified, set the dlname.
4620 if test "$module" = yes ||
test "$export_dynamic" = yes; then
4621 # On all known operating systems, these are identical.
4628 if test -n "$deplibs"; then
4629 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4632 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
4633 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4636 if test -n "$rpath"; then
4637 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4640 if test -n "$xrpath"; then
4641 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4644 if test -n "$vinfo"; then
4645 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4648 if test -n "$release"; then
4649 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4654 if test -n "$objs$old_deplibs"; then
4655 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4659 obj
=`$echo "X$output" | $Xsed -e "$lo2o"`
4667 # Delete the old objects.
4668 $run $rm $obj $libobj
4670 # Objects from convenience libraries. This assumes
4671 # single-version convenience libraries. Whenever we create
4672 # different ones for PIC/non-PIC, this we'll have to duplicate
4676 # reload_cmds runs $LD directly, so let us get rid of
4677 # -Wl from whole_archive_flag_spec
4680 if test -n "$convenience"; then
4681 if test -n "$whole_archive_flag_spec"; then
4682 eval reload_conv_objs
=\"\
$reload_objs $whole_archive_flag_spec\"
4684 gentop
="$output_objdir/${obj}x"
4685 generated
="$generated $gentop"
4687 func_extract_archives
$gentop $convenience
4688 reload_conv_objs
="$reload_objs $func_extract_archives_result"
4692 # Create the old-style object.
4693 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
4697 save_ifs
="$IFS"; IFS
='~'
4698 for cmd
in $cmds; do
4702 $run eval "$cmd" ||
exit $?
4706 # Exit if we aren't doing a library object file.
4707 if test -z "$libobj"; then
4708 if test -n "$gentop"; then
4709 $show "${rm}r $gentop"
4716 if test "$build_libtool_libs" != yes; then
4717 if test -n "$gentop"; then
4718 $show "${rm}r $gentop"
4722 # Create an invalid libtool object if no PIC, so that we don't
4723 # accidentally link it into a program.
4724 # $show "echo timestamp > $libobj"
4725 # $run eval "echo timestamp > $libobj" || exit $?
4729 if test -n "$pic_flag" ||
test "$pic_mode" != default
; then
4730 # Only do commands if we really have different PIC objects.
4731 reload_objs
="$libobjs $reload_conv_objs"
4734 save_ifs
="$IFS"; IFS
='~'
4735 for cmd
in $cmds; do
4739 $run eval "$cmd" ||
exit $?
4744 if test -n "$gentop"; then
4745 $show "${rm}r $gentop"
4754 *cygwin
*) output
=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4756 if test -n "$vinfo"; then
4757 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4760 if test -n "$release"; then
4761 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4764 if test "$preload" = yes; then
4765 if test "$dlopen_support" = unknown
&& test "$dlopen_self" = unknown
&&
4766 test "$dlopen_self_static" = unknown
; then
4767 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4772 *-*-rhapsody* |
*-*-darwin1.
[012])
4773 # On Rhapsody replace the C library is the System framework
4774 compile_deplibs
=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4775 finalize_deplibs
=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4781 # Don't allow lazy linking, it breaks C++ global constructors
4782 if test "$tagname" = CXX
; then
4783 compile_command
="$compile_command ${wl}-bind_at_load"
4784 finalize_command
="$finalize_command ${wl}-bind_at_load"
4790 # move library search paths that coincide with paths to not yet
4791 # installed libraries to the beginning of the library search list
4793 for path
in $notinst_path; do
4794 case " $new_libs " in
4795 *" -L$path/$objdir "*) ;;
4797 case " $compile_deplibs " in
4798 *" -L$path/$objdir "*)
4799 new_libs
="$new_libs -L$path/$objdir" ;;
4804 for deplib
in $compile_deplibs; do
4807 case " $new_libs " in
4809 *) new_libs
="$new_libs $deplib" ;;
4812 *) new_libs
="$new_libs $deplib" ;;
4815 compile_deplibs
="$new_libs"
4818 compile_command
="$compile_command $compile_deplibs"
4819 finalize_command
="$finalize_command $finalize_deplibs"
4821 if test -n "$rpath$xrpath"; then
4822 # If the user specified any rpath flags, then add them.
4823 for libdir
in $rpath $xrpath; do
4824 # This is the magic to use -rpath.
4825 case "$finalize_rpath " in
4827 *) finalize_rpath
="$finalize_rpath $libdir" ;;
4832 # Now hardcode the library paths
4835 for libdir
in $compile_rpath $finalize_rpath; do
4836 if test -n "$hardcode_libdir_flag_spec"; then
4837 if test -n "$hardcode_libdir_separator"; then
4838 if test -z "$hardcode_libdirs"; then
4839 hardcode_libdirs
="$libdir"
4841 # Just accumulate the unique libdirs.
4842 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4843 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4846 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4851 eval flag
=\"$hardcode_libdir_flag_spec\"
4852 rpath
="$rpath $flag"
4854 elif test -n "$runpath_var"; then
4855 case "$perm_rpath " in
4857 *) perm_rpath
="$perm_rpath $libdir" ;;
4861 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
4862 testbindir
=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
4863 case :$dllsearchpath: in
4865 *) dllsearchpath
="$dllsearchpath:$libdir";;
4867 case :$dllsearchpath: in
4868 *":$testbindir:"*) ;;
4869 *) dllsearchpath
="$dllsearchpath:$testbindir";;
4874 # Substitute the hardcoded libdirs into the rpath.
4875 if test -n "$hardcode_libdir_separator" &&
4876 test -n "$hardcode_libdirs"; then
4877 libdir
="$hardcode_libdirs"
4878 eval rpath
=\" $hardcode_libdir_flag_spec\"
4880 compile_rpath
="$rpath"
4884 for libdir
in $finalize_rpath; do
4885 if test -n "$hardcode_libdir_flag_spec"; then
4886 if test -n "$hardcode_libdir_separator"; then
4887 if test -z "$hardcode_libdirs"; then
4888 hardcode_libdirs
="$libdir"
4890 # Just accumulate the unique libdirs.
4891 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4892 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4895 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4900 eval flag
=\"$hardcode_libdir_flag_spec\"
4901 rpath
="$rpath $flag"
4903 elif test -n "$runpath_var"; then
4904 case "$finalize_perm_rpath " in
4906 *) finalize_perm_rpath
="$finalize_perm_rpath $libdir" ;;
4910 # Substitute the hardcoded libdirs into the rpath.
4911 if test -n "$hardcode_libdir_separator" &&
4912 test -n "$hardcode_libdirs"; then
4913 libdir
="$hardcode_libdirs"
4914 eval rpath
=\" $hardcode_libdir_flag_spec\"
4916 finalize_rpath
="$rpath"
4918 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4919 # Transform all the library objects into standard objects.
4920 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4921 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4925 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
4926 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4927 dlsyms
="${outputname}S.c"
4929 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4933 if test -n "$dlsyms"; then
4937 # Discover the nlist of each of the dlfiles.
4938 nlist
="$output_objdir/${outputname}.nm"
4940 $show "$rm $nlist ${nlist}S ${nlist}T"
4941 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4943 # Parse the name list into a source file.
4944 $show "creating $output_objdir/$dlsyms"
4946 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4947 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4948 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4954 /* Prevent the only kind of declaration conflicts we can make. */
4955 #define lt_preloaded_symbols some_other_symbol
4957 /* External symbol declarations for the compiler. */\
4960 if test "$dlself" = yes; then
4961 $show "generating symbol list for \`$output'"
4963 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4965 # Add our own program objects to the symbol list.
4966 progfiles
=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4967 for arg
in $progfiles; do
4968 $show "extracting global C symbols from \`$arg'"
4969 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4972 if test -n "$exclude_expsyms"; then
4973 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4974 $run eval '$mv "$nlist"T "$nlist"'
4977 if test -n "$export_symbols_regex"; then
4978 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4979 $run eval '$mv "$nlist"T "$nlist"'
4982 # Prepare the list of exported symbols
4983 if test -z "$export_symbols"; then
4984 export_symbols
="$output_objdir/$outputname.exp"
4985 $run $rm $export_symbols
4986 $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4988 *cygwin
* |
*mingw
* )
4989 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4990 $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4994 $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4995 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4996 $run eval 'mv "$nlist"T "$nlist"'
4998 *cygwin
* |
*mingw
* )
4999 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
5000 $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
5006 for arg
in $dlprefiles; do
5007 $show "extracting global C symbols from \`$arg'"
5008 name
=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
5009 $run eval '$echo ": $name " >> "$nlist"'
5010 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
5013 if test -z "$run"; then
5014 # Make sure we have at least an empty file.
5015 test -f "$nlist" ||
: > "$nlist"
5017 if test -n "$exclude_expsyms"; then
5018 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
5019 $mv "$nlist"T
"$nlist"
5022 # Try sorting and uniquifying the output.
5023 if grep -v "^: " < "$nlist" |
5024 if sort -k 3 </dev
/null
>/dev
/null
2>&1; then
5029 uniq > "$nlist"S
; then
5032 grep -v "^: " < "$nlist" > "$nlist"S
5035 if test -f "$nlist"S
; then
5036 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
5038 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
5041 $echo >> "$output_objdir/$dlsyms" "\
5043 #undef lt_preloaded_symbols
5045 #if defined (__STDC__) && __STDC__
5046 # define lt_ptr void *
5048 # define lt_ptr char *
5052 /* The mapping between symbol names and symbols. */
5056 *cygwin
* |
*mingw
* )
5057 $echo >> "$output_objdir/$dlsyms" "\
5058 /* DATA imports from DLLs on WIN32 can't be const, because
5059 runtime relocations are performed -- see ld's documentation
5065 $echo >> "$output_objdir/$dlsyms" "\
5072 $echo >> "$output_objdir/$dlsyms" "\
5076 lt_preloaded_symbols[] =
5080 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
5082 $echo >> "$output_objdir/$dlsyms" "\
5086 /* This works around a problem in FreeBSD linker */
5087 #ifdef FREEBSD_WORKAROUND
5088 static const void *lt_preloaded_setup() {
5089 return lt_preloaded_symbols;
5099 pic_flag_for_symtable
=
5101 # compiling the symbol table file with pic_flag works around
5102 # a FreeBSD bug that causes programs to crash when -lm is
5103 # linked before any other PIC object. But we must not use
5104 # pic_flag when linking with -static. The problem exists in
5105 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
5106 *-*-freebsd2*|
*-*-freebsd3.0
*|
*-*-freebsdelf3.0
*)
5107 case "$compile_command " in
5109 *) pic_flag_for_symtable
=" $pic_flag -DFREEBSD_WORKAROUND";;
5112 case "$compile_command " in
5114 *) pic_flag_for_symtable
=" $pic_flag";;
5118 # Now compile the dynamic symbol file.
5119 $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
5120 $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' ||
exit $?
5122 # Clean up the generated files.
5123 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
5124 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
5126 # Transform the symbol file into the correct name.
5128 *cygwin
* |
*mingw
* )
5129 if test -f "$output_objdir/${outputname}.def" ; then
5130 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
5131 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
5133 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
5134 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
5138 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
5139 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
5144 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
5149 # We keep going just in case the user didn't refer to
5150 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
5151 # really was required.
5153 # Nullify the symbol file.
5154 compile_command
=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
5155 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
5158 if test "$need_relink" = no ||
test "$build_libtool_libs" != yes; then
5159 # Replace the output file specification.
5160 compile_command
=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
5161 link_command
="$compile_command$compile_rpath"
5163 # We have no uninstalled library dependencies, so finalize right now.
5164 $show "$link_command"
5165 $run eval "$link_command"
5168 # Delete the generated files.
5169 if test -n "$dlsyms"; then
5170 $show "$rm $output_objdir/${outputname}S.${objext}"
5171 $run $rm "$output_objdir/${outputname}S.${objext}"
5177 if test -n "$shlibpath_var"; then
5178 # We should set the shlibpath_var
5180 for dir
in $temp_rpath; do
5182 [\\/]* |
[A-Za-z
]:[\\/]*)
5187 # Relative path: add a thisdir entry.
5188 rpath
="$rpath\$thisdir/$dir:"
5195 if test -n "$compile_shlibpath$finalize_shlibpath"; then
5196 compile_command
="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
5198 if test -n "$finalize_shlibpath"; then
5199 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
5204 if test -n "$runpath_var"; then
5205 if test -n "$perm_rpath"; then
5206 # We should set the runpath_var.
5208 for dir
in $perm_rpath; do
5211 compile_var
="$runpath_var=\"$rpath\$$runpath_var\" "
5213 if test -n "$finalize_perm_rpath"; then
5214 # We should set the runpath_var.
5216 for dir
in $finalize_perm_rpath; do
5219 finalize_var
="$runpath_var=\"$rpath\$$runpath_var\" "
5223 if test "$no_install" = yes; then
5224 # We don't need to create a wrapper script.
5225 link_command
="$compile_var$compile_command$compile_rpath"
5226 # Replace the output file specification.
5227 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
5228 # Delete the old output file.
5230 # Link the executable and exit
5231 $show "$link_command"
5232 $run eval "$link_command" ||
exit $?
5236 if test "$hardcode_action" = relink
; then
5237 # Fast installation is not supported
5238 link_command
="$compile_var$compile_command$compile_rpath"
5239 relink_command
="$finalize_var$finalize_command$finalize_rpath"
5241 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
5242 $echo "$modename: \`$output' will be relinked during installation" 1>&2
5244 if test "$fast_install" != no
; then
5245 link_command
="$finalize_var$compile_command$finalize_rpath"
5246 if test "$fast_install" = yes; then
5247 relink_command
=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
5249 # fast_install is set to needless
5253 link_command
="$compile_var$compile_command$compile_rpath"
5254 relink_command
="$finalize_var$finalize_command$finalize_rpath"
5258 # Replace the output file specification.
5259 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
5261 # Delete the old output files.
5262 $run $rm $output $output_objdir/$outputname $output_objdir/lt-
$outputname
5264 $show "$link_command"
5265 $run eval "$link_command" ||
exit $?
5267 # Now create the wrapper script.
5268 $show "creating $output"
5270 # Quote the relink command for shipping.
5271 if test -n "$relink_command"; then
5272 # Preserve any variables that may affect compiler behavior
5273 for var
in $variables_saved_for_relink; do
5274 if eval test -z \"\
${$var+set}\"; then
5275 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5276 elif eval var_value
=\$
$var; test -z "$var_value"; then
5277 relink_command
="$var=; export $var; $relink_command"
5279 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5280 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
5283 relink_command
="(cd `pwd`; $relink_command)"
5284 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5287 # Quote $echo for shipping.
5288 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
5290 [\\/]* |
[A-Za-z
]:[\\/]*) qecho
="$SHELL $progpath --fallback-echo";;
5291 *) qecho
="$SHELL `pwd`/$progpath --fallback-echo";;
5293 qecho
=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
5295 qecho
=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
5298 # Only actually do things if our run command is non-null.
5299 if test -z "$run"; then
5300 # win32 will think the script is a binary if it has
5301 # a .exe suffix, so we strip it off here.
5303 *.exe
) output
=`$echo $output|${SED} 's,.exe$,,'` ;;
5305 # test for cygwin because mv fails w/o .exe extensions
5309 outputname
=`$echo $outputname|${SED} 's,.exe$,,'` ;;
5313 *cygwin
* |
*mingw
* )
5314 output_name
=`basename $output`
5315 output_path
=`dirname $output`
5316 cwrappersource
="$output_path/$objdir/lt-$output_name.c"
5317 cwrapper
="$output_path/$output_name.exe"
5318 $rm $cwrappersource $cwrapper
5319 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
5321 cat > $cwrappersource <<EOF
5323 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
5324 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5326 The $output program cannot be directly executed until all the libtool
5327 libraries that it depends on are installed.
5329 This wrapper executable should never be moved out of the build directory.
5330 If it is, it will not operate correctly.
5332 Currently, it simply execs the wrapper *script* "/bin/sh $output",
5333 but could eventually absorb all of the scripts functionality and
5334 exec $objdir/$outputname directly.
5337 cat >> $cwrappersource<<"EOF"
5346 #include <sys/stat.h>
5348 #if defined(PATH_MAX)
5349 # define LT_PATHMAX PATH_MAX
5350 #elif defined(MAXPATHLEN)
5351 # define LT_PATHMAX MAXPATHLEN
5353 # define LT_PATHMAX 1024
5356 #ifndef DIR_SEPARATOR
5357 # define DIR_SEPARATOR '/'
5358 # define PATH_SEPARATOR ':'
5361 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
5363 # define HAVE_DOS_BASED_FILE_SYSTEM
5364 # ifndef DIR_SEPARATOR_2
5365 # define DIR_SEPARATOR_2 '\\'
5367 # ifndef PATH_SEPARATOR_2
5368 # define PATH_SEPARATOR_2 ';'
5372 #ifndef DIR_SEPARATOR_2
5373 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
5374 #else /* DIR_SEPARATOR_2 */
5375 # define IS_DIR_SEPARATOR(ch) \
5376 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
5377 #endif /* DIR_SEPARATOR_2 */
5379 #ifndef PATH_SEPARATOR_2
5380 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
5381 #else /* PATH_SEPARATOR_2 */
5382 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
5383 #endif /* PATH_SEPARATOR_2 */
5385 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
5386 #define XFREE(stale) do { \
5387 if (stale) { free ((void *) stale); stale = 0; } \
5390 /* -DDEBUG is fairly common in CFLAGS. */
5392 #if defined DEBUGWRAPPER
5393 # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
5395 # define DEBUG(format, ...)
5398 const char *program_name = NULL;
5400 void * xmalloc (size_t num);
5401 char * xstrdup (const char *string);
5402 const char * base_name (const char *name);
5403 char * find_executable(const char *wrapper);
5404 int check_executable(const char *path);
5405 char * strendzap(char *str, const char *pat);
5406 void lt_fatal (const char *message, ...);
5409 main (int argc, char *argv[])
5414 program_name = (char *) xstrdup (base_name (argv[0]));
5415 DEBUG("(main) argv[0] : %s\n",argv[0]);
5416 DEBUG("(main) program_name : %s\n",program_name);
5417 newargz = XMALLOC(char *, argc+2);
5420 cat >> $cwrappersource <<EOF
5421 newargz[0] = (char *) xstrdup("$SHELL");
5424 cat >> $cwrappersource <<"EOF"
5425 newargz
[1] = find_executable
(argv
[0]);
5426 if (newargz
[1] == NULL
)
5427 lt_fatal
("Couldn't find %s", argv
[0]);
5428 DEBUG
("(main) found exe at : %s\n",newargz
[1]);
5429 /* we know the
script has the same name
, without the .exe
*/
5430 /* so
make sure newargz
[1] doesn
't end in .exe */
5431 strendzap(newargz[1],".exe");
5432 for (i = 1; i < argc; i++)
5433 newargz[i+1] = xstrdup(argv[i]);
5434 newargz[argc+1] = NULL;
5436 for (i=0; i<argc+1; i++)
5438 DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
5446 cat >> $cwrappersource <<EOF
5447 execv("$SHELL",(char const **)newargz);
5451 cat >> $cwrappersource <<EOF
5452 execv("$SHELL",newargz);
5457 cat >> $cwrappersource <<"EOF"
5462 xmalloc (size_t num)
5464 void * p = (void *) malloc (num);
5466 lt_fatal ("Memory exhausted");
5472 xstrdup (const char *string)
5474 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5479 base_name (const char *name)
5483 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5484 /* Skip over the disk name in MSDOS pathnames. */
5485 if (isalpha ((unsigned char)name[0]) && name[1] == ':')
5489 for (base = name; *name; name++)
5490 if (IS_DIR_SEPARATOR (*name))
5496 check_executable(const char * path)
5500 DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
5501 if ((!path) || (!*path))
5504 if ((stat (path, &st) >= 0) &&
5506 /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
5507 #if defined (S_IXOTH)
5508 ((st.st_mode & S_IXOTH) == S_IXOTH) ||
5510 #if defined (S_IXGRP)
5511 ((st.st_mode & S_IXGRP) == S_IXGRP) ||
5513 ((st.st_mode & S_IXUSR) == S_IXUSR))
5520 /* Searches for the full path of the wrapper. Returns
5521 newly allocated full path name if found, NULL otherwise */
5523 find_executable (const char* wrapper)
5528 /* static buffer for getcwd */
5529 char tmp[LT_PATHMAX + 1];
5533 DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
5535 if ((wrapper == NULL) || (*wrapper == '\
0'))
5538 /* Absolute path? */
5539 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5540 if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
5542 concat_name = xstrdup (wrapper);
5543 if (check_executable(concat_name))
5550 if (IS_DIR_SEPARATOR (wrapper[0]))
5552 concat_name = xstrdup (wrapper);
5553 if (check_executable(concat_name))
5557 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5561 for (p = wrapper; *p; p++)
5569 /* no slashes; search PATH */
5570 const char* path = getenv ("PATH");
5573 for (p = path; *p; p = p_next)
5577 for (q = p; *q; q++)
5578 if (IS_PATH_SEPARATOR(*q))
5581 p_next = (*q == '\
0' ? q : q + 1);
5584 /* empty path: current directory */
5585 if (getcwd (tmp, LT_PATHMAX) == NULL)
5586 lt_fatal ("getcwd failed");
5587 tmp_len = strlen(tmp);
5588 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5589 memcpy (concat_name, tmp, tmp_len);
5590 concat_name[tmp_len] = '/';
5591 strcpy (concat_name + tmp_len + 1, wrapper);
5595 concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
5596 memcpy (concat_name, p, p_len);
5597 concat_name[p_len] = '/';
5598 strcpy (concat_name + p_len + 1, wrapper);
5600 if (check_executable(concat_name))
5605 /* not found in PATH; assume curdir */
5607 /* Relative path | not found in path: prepend cwd */
5608 if (getcwd (tmp, LT_PATHMAX) == NULL)
5609 lt_fatal ("getcwd failed");
5610 tmp_len = strlen(tmp);
5611 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5612 memcpy (concat_name, tmp, tmp_len);
5613 concat_name[tmp_len] = '/';
5614 strcpy (concat_name + tmp_len + 1, wrapper);
5616 if (check_executable(concat_name))
5623 strendzap(char *str, const char *pat)
5627 assert(str != NULL);
5628 assert(pat != NULL);
5631 patlen = strlen(pat);
5635 str += len - patlen;
5636 if (strcmp(str, pat) == 0)
5643 lt_error_core (int exit_status, const char * mode,
5644 const char * message, va_list ap)
5646 fprintf (stderr, "%s: %s: ", program_name, mode);
5647 vfprintf (stderr, message, ap);
5648 fprintf (stderr, ".\n");
5650 if (exit_status >= 0)
5655 lt_fatal (const char *message, ...)
5658 va_start (ap, message);
5659 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5663 # we should really use a build-platform specific compiler
5664 # here, but OTOH, the wrappers (shell script and this C one)
5665 # are only useful if you want to execute the "real" binary.
5666 # Since the "real" binary is built for $host, then this
5667 # wrapper might as well be built for $host, too.
5668 $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
5672 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5677 # $output - temporary wrapper script for $objdir/$outputname
5678 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5680 # The $output program cannot be directly executed until all the libtool
5681 # libraries that it depends on are installed.
5683 # This wrapper script should never be moved out of the build directory.
5684 # If it is, it will not operate correctly.
5686 # Sed substitution that helps us do robust quoting. It backslashifies
5687 # metacharacters that are still active within double-quoted strings.
5688 Xsed='${SED} -e 1s
/^X
//'
5689 sed_quote_subst='$sed_quote_subst'
5691 # The HP-UX ksh and POSIX shell print the target directory to stdout
5693 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5695 relink_command=\"$relink_command\"
5697 # This environment variable determines our operation mode.
5698 if test \"\$libtool_install_magic\" = \"$magic\"; then
5699 # install mode needs the following variable:
5700 notinst_deplibs='$notinst_deplibs'
5702 # When we are sourced in execute mode, \$file and \$echo are already set.
5703 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5706 # Make sure echo works.
5707 if test \"X\$1\" = X--no-reexec; then
5708 # Discard the --no-reexec flag, and continue.
5710 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X
\t'; then
5711 # Yippee, \$echo works!
5714 # Restart under the correct shell, and then maybe \$echo will work.
5715 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5721 # Find the directory that this script lives in.
5722 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's
%/[^
/]*$
%%'\`
5723 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5725 # Follow symbolic links until we get to the real thisdir.
5726 file=\`ls -ld \"\$file\" | ${SED} -n 's
/.
*-> //p
'\`
5727 while test -n \"\$file\"; do
5728 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's
%/[^
/]*\$
%%'\`
5730 # If there was a directory component, then change thisdir.
5731 if test \"x\$destdir\" != \"x\$file\"; then
5732 case \"\$destdir\" in
5733 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5734 *) thisdir=\"\$thisdir/\$destdir\" ;;
5738 file=\`\$echo \"X\$file\" | \$Xsed -e 's
%^.
*/%%'\`
5739 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's
/.
*-> //p
'\`
5742 # Try to get the absolute directory name.
5743 absdir=\`cd \"\$thisdir\" && pwd\`
5744 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5747 if test "$fast_install" = yes; then
5749 program=lt-'$outputname'$exeext
5750 progdir=\"\$thisdir/$objdir\"
5752 if test ! -f \"\$progdir/\$program\" || \\
5753 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5754 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5756 file=\"\$\$-\$program\"
5758 if test ! -d \"\$progdir\"; then
5759 $mkdir \"\$progdir\"
5761 $rm \"\$progdir/\$file\"
5766 # relink executable if necessary
5767 if test -n \"\$relink_command\"; then
5768 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5770 $echo \"\$relink_command_output\" >&2
5771 $rm \"\$progdir/\$file\"
5776 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5777 { $rm \"\$progdir/\$program\";
5778 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5779 $rm \"\$progdir/\$file\"
5783 program='$outputname'
5784 progdir=\"\$thisdir/$objdir\"
5790 if test -f \"\$progdir/\$program\"; then"
5792 # Export our shlibpath_var if we have one.
5793 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5795 # Add our own library path to $shlibpath_var
5796 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5798 # Some systems cannot cope with colon-terminated $shlibpath_var
5799 # The second colon is a workaround for a bug in BeOS R4 sed
5800 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's
/::*\$
//'\`
5802 export $shlibpath_var
5806 # fixup the dll searchpath if we need to.
5807 if test -n "$dllsearchpath"; then
5809 # Add the dll search path components to the executable PATH
5810 PATH=$dllsearchpath:\$PATH
5815 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5816 # Run the actual program with our arguments.
5818 # Make sure env LD_LIBRARY_PATH does not mess us up
5819 if test -n \"\${LD_LIBRARY_PATH+set}\"; then
5820 export LD_LIBRARY_PATH=\$progdir:\$LD_LIBRARY_PATH
5824 # Backslashes separate directories on plain windows
5825 *-*-mingw | *-*-os2*)
5827 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5833 exec \"\$progdir/\$program\" \${1+\"\$@\"}
5838 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
5842 # The program doesn't exist.
5843 \
$echo \"\
$0: error
: \\\
`\$progdir/\$program' does not exist\" 1>&2
5844 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5845 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5856 # See if we need to build an old-fashioned archive.
5857 for oldlib in $oldlibs; do
5859 if test "$build_libtool_libs" = convenience; then
5860 oldobjs="$libobjs_save"
5861 addlibs="$convenience"
5862 build_libtool_libs=no
5864 if test "$build_libtool_libs" = module; then
5865 oldobjs="$libobjs_save"
5866 build_libtool_libs=no
5868 oldobjs="$old_deplibs $non_pic_objects"
5870 addlibs="$old_convenience"
5873 if test -n "$addlibs"; then
5874 gentop="$output_objdir/${outputname}x"
5875 generated="$generated $gentop"
5877 func_extract_archives $gentop $addlibs
5878 oldobjs="$oldobjs $func_extract_archives_result"
5881 # Do each command in the archive commands.
5882 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5883 cmds=$old_archive_from_new_cmds
5885 # POSIX demands no paths to be encoded in archives. We have
5886 # to avoid creating archives with duplicate basenames if we
5887 # might have to extract them afterwards, e.g., when creating a
5888 # static archive out of a convenience library, or when linking
5889 # the entirety of a libtool archive into another (currently
5890 # not supported by libtool).
5891 if (for obj in $oldobjs
5893 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5894 done | sort | sort -uc >/dev/null 2>&1); then
5897 $echo "copying selected object files to avoid basename conflicts..."
5899 if test -z "$gentop"; then
5900 gentop="$output_objdir/${outputname}x"
5901 generated="$generated $gentop"
5903 $show "${rm}r $gentop"
5904 $run ${rm}r "$gentop"
5905 $show "$mkdir $gentop"
5906 $run $mkdir "$gentop"
5908 if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
5913 save_oldobjs=$oldobjs
5916 for obj in $save_oldobjs
5918 objbase=`$echo "X$obj" |
$Xsed -e 's%^.*/%%'`
5919 case " $oldobjs " in
5920 " ") oldobjs=$obj ;;
5923 # Make sure we don't pick an alternate name that also
5925 newobj=lt$counter-$objbase
5926 counter=`expr $counter + 1`
5927 case " $oldobjs " in
5928 *[\ /]"$newobj "*) ;;
5929 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
5932 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5933 $run ln "$obj" "$gentop/$newobj" ||
5934 $run cp "$obj" "$gentop/$newobj"
5935 oldobjs="$oldobjs $gentop/$newobj"
5937 *) oldobjs="$oldobjs $obj" ;;
5942 eval cmds=\"$old_archive_cmds\"
5944 if len=`expr "X$cmds" : ".*"` &&
5945 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5946 cmds=$old_archive_cmds
5948 # the command line is too long to link in one step, link in parts
5949 $echo "using piecewise archive linking..."
5954 save_oldobjs=$oldobjs
5956 # Is there a better way of finding the last object in the list?
5957 for obj in $save_oldobjs
5961 for obj in $save_oldobjs
5963 oldobjs="$objlist $obj"
5964 objlist="$objlist $obj"
5965 eval test_cmds=\"$old_archive_cmds\"
5966 if len=`expr "X$test_cmds" : ".*" 2>/dev
/null
` &&
5967 test "$len" -le "$max_cmd_len"; then
5970 # the above command should be used before it gets too long
5972 if test "$obj" = "$last_oldobj" ; then
5975 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5976 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5982 if test "X$oldobjs" = "X" ; then
5983 eval cmds=\"\$concat_cmds\"
5985 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5989 save_ifs="$IFS"; IFS='~'
5990 for cmd in $cmds; do
5994 $run eval "$cmd" || exit $?
5999 if test -n "$generated"; then
6000 $show "${rm}r$generated"
6001 $run ${rm}r$generated
6004 # Now create the libtool archive.
6008 test "$build_old_libs" = yes && old_library="$libname.$libext"
6009 $show "creating $output"
6011 # Preserve any variables that may affect compiler behavior
6012 for var in $variables_saved_for_relink; do
6013 if eval test -z \"\${$var+set}\"; then
6014 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
6015 elif eval var_value=\$$var; test -z "$var_value"; then
6016 relink_command="$var=; export $var; $relink_command"
6018 var_value=`$echo "X$var_value" |
$Xsed -e "$sed_quote_subst"`
6019 relink_command="$var=\"$var_value\"; export $var; $relink_command"
6022 # Quote the link command for shipping.
6023 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
6024 relink_command=`$echo "X$relink_command" |
$Xsed -e "$sed_quote_subst"`
6025 if test "$hardcode_automatic" = yes ; then
6030 # Only create the output if not a dry run.
6031 if test -z "$run"; then
6032 for installed in no yes; do
6033 if test "$installed" = yes; then
6034 if test -z "$install_libdir"; then
6037 output="$output_objdir/$outputname"i
6038 # Replace all uninstalled libtool libraries with the installed ones
6040 for deplib in $dependency_libs; do
6043 name=`$echo "X$deplib" |
$Xsed -e 's%^.*/%%'`
6044 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
6045 if test -z "$libdir"; then
6046 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
6049 if test "X$EGREP" = X ; then
6052 # We do not want portage's
install root
($D) present. Check only
for
6053 # this if the .la is being installed.
6054 if test "$installed" = yes && test "$D"; then
6055 eval mynewdependency_lib
=`echo "$libdir/$name" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
6057 mynewdependency_lib
="$libdir/$name"
6059 # Do not add duplicates
6060 if test "$mynewdependency_lib"; then
6061 my_little_ninja_foo_1
=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"`
6062 if test -z "$my_little_ninja_foo_1"; then
6063 newdependency_libs
="$newdependency_libs $mynewdependency_lib"
6068 if test "$installed" = yes; then
6069 # Rather use S=WORKDIR if our version of portage supports it.
6070 # This is because some ebuild (gcc) do not use $S as buildroot.
6071 if test "$PWORKDIR"; then
6074 # We do not want portage's build root ($S) present.
6075 my_little_ninja_foo_2
=`echo $deplib |$EGREP -e "$S"`
6076 # We do not want portage's install root ($D) present.
6077 my_little_ninja_foo_3
=`echo $deplib |$EGREP -e "$D"`
6078 if test -n "$my_little_ninja_foo_2" && test "$S"; then
6079 mynewdependency_lib
=""
6080 elif test -n "$my_little_ninja_foo_3" && test "$D"; then
6081 eval mynewdependency_lib
=`echo "$deplib" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
6083 mynewdependency_lib
="$deplib"
6086 mynewdependency_lib
="$deplib"
6088 # Do not add duplicates
6089 if test "$mynewdependency_lib"; then
6090 my_little_ninja_foo_4
=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"`
6091 if test -z "$my_little_ninja_foo_4"; then
6092 newdependency_libs
="$newdependency_libs $mynewdependency_lib"
6098 dependency_libs
="$newdependency_libs"
6100 for lib
in $dlfiles; do
6101 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
6102 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
6103 if test -z "$libdir"; then
6104 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6107 newdlfiles
="$newdlfiles $libdir/$name"
6109 dlfiles
="$newdlfiles"
6111 for lib
in $dlprefiles; do
6112 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
6113 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
6114 if test -z "$libdir"; then
6115 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6118 newdlprefiles
="$newdlprefiles $libdir/$name"
6120 dlprefiles
="$newdlprefiles"
6123 for lib
in $dlfiles; do
6125 [\\/]* |
[A-Za-z
]:[\\/]*) abs
="$lib" ;;
6126 *) abs
=`pwd`"/$lib" ;;
6128 newdlfiles
="$newdlfiles $abs"
6130 dlfiles
="$newdlfiles"
6132 for lib
in $dlprefiles; do
6134 [\\/]* |
[A-Za-z
]:[\\/]*) abs
="$lib" ;;
6135 *) abs
=`pwd`"/$lib" ;;
6137 newdlprefiles
="$newdlprefiles $abs"
6139 dlprefiles
="$newdlprefiles"
6142 # place dlname in correct position for cygwin
6144 case $host,$output,$installed,$module,$dlname in
6145 *cygwin
*,*lai
,yes,no
,*.dll |
*mingw
*,*lai
,yes,no
,*.dll
) tdlname
=..
/bin
/$dlname ;;
6147 # Do not add duplicates
6148 if test "$installed" = yes && test "$D"; then
6149 install_libdir
=`echo "$install_libdir" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
6152 # $outputname - a libtool library file
6153 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
6155 # Please DO NOT delete this file!
6156 # It is necessary for linking the library.
6158 # The name that we can dlopen(3).
6161 # Names of this library.
6162 library_names='$library_names'
6164 # The name of the static archive.
6165 old_library='$old_library'
6167 # Libraries that this one depends upon.
6168 dependency_libs='$dependency_libs'
6170 # Version information for $libname.
6175 # Is this an already installed library?
6176 installed=$installed
6178 # Should we warn about portability when linking against -modules?
6179 shouldnotlink=$module
6181 # Files to dlopen/dlpreopen
6183 dlpreopen='$dlprefiles'
6185 # Directory that this library needs to be installed in:
6186 libdir='$install_libdir'"
6187 if test "$installed" = no
&& test "$need_relink" = yes; then
6189 relink_command=\"$relink_command\""
6194 # Do a symbolic link so that the libtool archive can be found in
6195 # LD_LIBRARY_PATH before the program is installed.
6196 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
6197 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' ||
exit $?
6203 # libtool install mode
6205 modename
="$modename: install"
6207 # There may be an optional sh(1) argument at the beginning of
6208 # install_prog (especially on Windows NT).
6209 if test "$nonopt" = "$SHELL" ||
test "$nonopt" = /bin
/sh ||
6210 # Allow the use of GNU shtool's install command.
6211 $echo "X$nonopt" |
grep shtool
> /dev
/null
; then
6212 # Aesthetically quote it.
6213 arg
=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
6215 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6219 install_prog
="$arg "
6227 # The real first argument should be the name of the installation program.
6228 # Aesthetically quote it.
6229 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
6231 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6235 install_prog
="$install_prog$arg"
6237 # We need to accept at least all the BSD install flags.
6247 if test -n "$dest"; then
6248 files
="$files $dest"
6256 case " $install_prog " in
6261 -g |
-m |
-o) prev
=$arg ;;
6269 # If the previous option needed an argument, then skip it.
6270 if test -n "$prev"; then
6279 # Aesthetically quote the argument.
6280 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
6282 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6286 install_prog
="$install_prog $arg"
6289 if test -z "$install_prog"; then
6290 $echo "$modename: you must specify an install program" 1>&2
6295 if test -n "$prev"; then
6296 $echo "$modename: the \`$prev' option requires an argument" 1>&2
6301 if test -z "$files"; then
6302 if test -z "$dest"; then
6303 $echo "$modename: no file or destination specified" 1>&2
6305 $echo "$modename: you must specify a destination" 1>&2
6311 # Strip any trailing slash from the destination.
6312 dest
=`$echo "X$dest" | $Xsed -e 's%/$%%'`
6314 # Check to see that the destination is a directory.
6315 test -d "$dest" && isdir
=yes
6316 if test "$isdir" = yes; then
6320 destdir
=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
6321 test "X$destdir" = "X$dest" && destdir
=.
6322 destname
=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
6324 # Not a directory, so check to see that there is only one file specified.
6326 if test "$#" -gt 2; then
6327 $echo "$modename: \`$dest' is not a directory" 1>&2
6333 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
6335 for file in $files; do
6339 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
6348 # This variable tells wrapper scripts just to set variables rather
6349 # than running their programs.
6350 libtool_install_magic
="$magic"
6355 for file in $files; do
6357 # Do each installation.
6360 # Do the static libraries later.
6361 staticlibs
="$staticlibs $file"
6365 # Check to see that this really is a libtool archive.
6366 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
6368 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
6376 # If there is no directory component, then add one.
6378 */* |
*\\*) .
$file ;;
6382 # Add the libdir to current_libdirs if it is the destination.
6383 if test "X$destdir" = "X$libdir"; then
6384 case "$current_libdirs " in
6386 *) current_libdirs
="$current_libdirs $libdir" ;;
6389 # Note the libdir as a future libdir.
6390 case "$future_libdirs " in
6392 *) future_libdirs
="$future_libdirs $libdir" ;;
6396 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
6397 test "X$dir" = "X$file/" && dir
=
6400 if test -n "$relink_command"; then
6401 # Determine the prefix the user has applied to our future dir.
6402 inst_prefix_dir
=`$echo "$destdir" | $SED "s%$libdir\$%%"`
6404 # Don't allow the user to place us outside of our expected
6405 # location b/c this prevents finding dependent libraries that
6406 # are installed to the same prefix.
6407 # At present, this check doesn't affect windows .dll's that
6408 # are installed into $libdir/../bin (currently, that works fine)
6409 # but it's something to keep an eye on.
6410 if test "$inst_prefix_dir" = "$destdir"; then
6411 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
6415 if test -n "$inst_prefix_dir"; then
6416 # Stick the inst_prefix_dir data into the link command.
6417 relink_command
=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
6419 relink_command
=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
6422 $echo "$modename: warning: relinking \`$file'" 1>&2
6423 $show "$relink_command"
6424 if $run eval "$relink_command"; then :
6426 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6431 # See the names of the shared library.
6432 set dummy
$library_names
6433 if test -n "$2"; then
6439 test -n "$relink_command" && srcname
="$realname"T
6441 # Install the shared library and build the symlinks.
6442 $show "$install_prog $dir/$srcname $destdir/$realname"
6443 $run eval "$install_prog $dir/$srcname $destdir/$realname" ||
exit $?
6444 if test -n "$stripme" && test -n "$striplib"; then
6445 $show "$striplib $destdir/$realname"
6446 $run eval "$striplib $destdir/$realname" ||
exit $?
6449 if test "$#" -gt 0; then
6450 # Delete the old symlinks, and create new ones.
6451 # Try `ln -sf' first, because the `ln' binary might depend on
6452 # the symlink we replace! Solaris /bin/ln does not understand -f,
6453 # so we also need to try rm && ln -s.
6456 if test "$linkname" != "$realname"; then
6457 $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6458 $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6463 # Do each command in the postinstall commands.
6464 lib
="$destdir/$realname"
6465 cmds
=$postinstall_cmds
6466 save_ifs
="$IFS"; IFS
='~'
6467 for cmd
in $cmds; do
6471 $run eval "$cmd" ||
{
6474 # Restore the uninstalled library and exit
6475 if test "$mode" = relink
; then
6476 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
6485 # Install the pseudo-library for information purposes.
6486 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6487 instname
="$dir/$name"i
6488 $show "$install_prog $instname $destdir/$name"
6489 $run eval "$install_prog $instname $destdir/$name" ||
exit $?
6491 # Maybe install the static library, too.
6492 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
6496 # Install (i.e. copy) a libtool object.
6498 # Figure out destination file name, if it wasn't already specified.
6499 if test -n "$destname"; then
6500 destfile
="$destdir/$destname"
6502 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6503 destfile
="$destdir/$destfile"
6506 # Deduce the name of the destination old-style object file.
6509 staticdest
=`$echo "X$destfile" | $Xsed -e "$lo2o"`
6512 staticdest
="$destfile"
6516 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
6522 # Install the libtool object if requested.
6523 if test -n "$destfile"; then
6524 $show "$install_prog $file $destfile"
6525 $run eval "$install_prog $file $destfile" ||
exit $?
6528 # Install the old object if enabled.
6529 if test "$build_old_libs" = yes; then
6530 # Deduce the name of the old-style object file.
6531 staticobj
=`$echo "X$file" | $Xsed -e "$lo2o"`
6533 $show "$install_prog $staticobj $staticdest"
6534 $run eval "$install_prog \$staticobj \$staticdest" ||
exit $?
6540 # Figure out destination file name, if it wasn't already specified.
6541 if test -n "$destname"; then
6542 destfile
="$destdir/$destname"
6544 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6545 destfile
="$destdir/$destfile"
6548 # If the file is missing, and there is a .exe on the end, strip it
6549 # because it is most likely a libtool script we actually want to
6554 if test ! -f "$file"; then
6555 file=`$echo $file|${SED} 's,.exe$,,'`
6561 # Do a test to see if this is really a libtool program.
6564 wrapper
=`$echo $file | ${SED} -e 's,.exe$,,'`
6570 if (${SED} -e '4q' $wrapper |
grep "^# Generated by .*$PACKAGE")>/dev
/null
2>&1; then
6574 # Note that it is not necessary on cygwin/mingw to append a dot to
6575 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6576 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6577 # `FILE.' does not work on cygwin managed mounts.
6579 # If there is no directory component, then add one.
6581 */* |
*\\*) .
${wrapper} ;;
6582 *) . .
/${wrapper} ;;
6585 # Check the variables that should have been set.
6586 if test -z "$notinst_deplibs"; then
6587 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
6592 for lib
in $notinst_deplibs; do
6593 # Check to see that each library is installed.
6595 if test -f "$lib"; then
6596 # If there is no directory component, then add one.
6598 */* |
*\\*) .
$lib ;;
6602 libfile
="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
6603 if test -n "$libdir" && test ! -f "$libfile"; then
6604 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
6610 # Note that it is not necessary on cygwin/mingw to append a dot to
6611 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6612 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6613 # `FILE.' does not work on cygwin managed mounts.
6615 # If there is no directory component, then add one.
6617 */* |
*\\*) .
${wrapper} ;;
6618 *) . .
/${wrapper} ;;
6622 if test "$fast_install" = no
&& test -n "$relink_command"; then
6623 if test "$finalize" = yes && test -z "$run"; then
6624 tmpdir
=`func_mktempdir`
6625 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6626 outputname
="$tmpdir/$file"
6627 # Replace the output file specification.
6628 relink_command
=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
6630 $show "$relink_command"
6631 if $run eval "$relink_command"; then :
6633 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6639 $echo "$modename: warning: cannot relink \`$file'" 1>&2
6642 # Install the binary that we compiled earlier.
6643 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
6647 # remove .exe since cygwin /usr/bin/install will append another
6649 case $install_prog,$host in
6650 */usr
/bin
/install*,*cygwin
*)
6651 case $file:$destfile in
6656 destfile
=$destfile.exe
6659 destfile
=`$echo $destfile | ${SED} -e 's,.exe$,,'`
6664 $show "$install_prog$stripme $file $destfile"
6665 $run eval "$install_prog\$stripme \$file \$destfile" ||
exit $?
6666 test -n "$outputname" && ${rm}r
"$tmpdir"
6671 for file in $staticlibs; do
6672 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6674 # Set up the ranlib parameters.
6675 oldlib
="$destdir/$name"
6677 $show "$install_prog $file $oldlib"
6678 $run eval "$install_prog \$file \$oldlib" ||
exit $?
6680 if test -n "$stripme" && test -n "$old_striplib"; then
6681 $show "$old_striplib $oldlib"
6682 $run eval "$old_striplib $oldlib" ||
exit $?
6685 # Do each command in the postinstall commands.
6686 cmds
=$old_postinstall_cmds
6687 save_ifs
="$IFS"; IFS
='~'
6688 for cmd
in $cmds; do
6692 $run eval "$cmd" ||
exit $?
6697 if test -n "$future_libdirs"; then
6698 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
6701 if test -n "$current_libdirs"; then
6702 # Maybe just do a dry run.
6703 test -n "$run" && current_libdirs
=" -n$current_libdirs"
6704 exec_cmd
='$SHELL $progpath $preserve_args --finish$current_libdirs'
6710 # libtool finish mode
6712 modename
="$modename: finish"
6716 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
6719 libdirs
="$libdirs $dir"
6722 for libdir
in $libdirs; do
6723 if test -n "$finish_cmds"; then
6724 # Do each command in the finish commands.
6726 save_ifs
="$IFS"; IFS
='~'
6727 for cmd
in $cmds; do
6731 $run eval "$cmd" || admincmds
="$admincmds
6736 if test -n "$finish_eval"; then
6737 # Do the single finish_eval.
6738 eval cmds
=\"$finish_eval\"
6739 $run eval "$cmds" || admincmds
="$admincmds
6745 # Exit here if they wanted silent mode.
6746 test "$show" = : && exit $EXIT_SUCCESS
6748 $echo "X----------------------------------------------------------------------" |
$Xsed
6749 $echo "Libraries have been installed in:"
6750 for libdir
in $libdirs; do
6754 $echo "If you ever happen to want to link against installed libraries"
6755 $echo "in a given directory, LIBDIR, you must either use libtool, and"
6756 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6757 $echo "flag during linking and do at least one of the following:"
6758 if test -n "$shlibpath_var"; then
6759 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6760 $echo " during execution"
6762 if test -n "$runpath_var"; then
6763 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
6764 $echo " during linking"
6766 if test -n "$hardcode_libdir_flag_spec"; then
6768 eval flag
=\"$hardcode_libdir_flag_spec\"
6770 $echo " - use the \`$flag' linker flag"
6772 if test -n "$admincmds"; then
6773 $echo " - have your system administrator run these commands:$admincmds"
6775 if test -f /etc
/ld.so.conf
; then
6776 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6779 $echo "See any operating system documentation about shared libraries for"
6780 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6781 $echo "X----------------------------------------------------------------------" |
$Xsed
6785 # libtool execute mode
6787 modename
="$modename: execute"
6789 # The first argument is the command name.
6791 if test -z "$cmd"; then
6792 $echo "$modename: you must specify a COMMAND" 1>&2
6797 # Handle -dlopen flags immediately.
6798 for file in $execute_dlfiles; do
6799 if test ! -f "$file"; then
6800 $echo "$modename: \`$file' is not a file" 1>&2
6808 # Check to see that this really is a libtool archive.
6809 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
6811 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6816 # Read the libtool library.
6820 # If there is no directory component, then add one.
6822 */* |
*\\*) .
$file ;;
6826 # Skip this library if it cannot be dlopened.
6827 if test -z "$dlname"; then
6828 # Warn if it was a shared library.
6829 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6833 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6834 test "X$dir" = "X$file" && dir
=.
6836 if test -f "$dir/$objdir/$dlname"; then
6839 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6845 # Just add the directory containing the .lo file.
6846 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6847 test "X$dir" = "X$file" && dir
=.
6851 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6856 # Get the absolute pathname.
6857 absdir
=`cd "$dir" && pwd`
6858 test -n "$absdir" && dir
="$absdir"
6860 # Now add the directory to shlibpath_var.
6861 if eval "test -z \"\$$shlibpath_var\""; then
6862 eval "$shlibpath_var=\"\$dir\""
6864 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6868 # This variable tells wrapper scripts just to set shlibpath_var
6869 # rather than running their programs.
6870 libtool_execute_magic
="$magic"
6872 # Check if any of the arguments is a wrapper script.
6879 # Do a test to see if this is really a libtool program.
6880 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6881 # If there is no directory component, then add one.
6883 */* |
*\\*) .
$file ;;
6887 # Transform arg to wrapped name.
6888 file="$progdir/$program"
6892 # Quote arguments (to preserve shell metacharacters).
6893 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6894 args
="$args \"$file\""
6897 if test -z "$run"; then
6898 if test -n "$shlibpath_var"; then
6899 # Export the shlibpath_var.
6900 eval "export $shlibpath_var"
6903 # Restore saved environment variables
6904 if test "${save_LC_ALL+set}" = set; then
6905 LC_ALL
="$save_LC_ALL"; export LC_ALL
6907 if test "${save_LANG+set}" = set; then
6908 LANG
="$save_LANG"; export LANG
6911 # Now prepare to actually exec the command.
6912 exec_cmd
="\$cmd$args"
6914 # Display what would be done.
6915 if test -n "$shlibpath_var"; then
6916 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6917 $echo "export $shlibpath_var"
6924 # libtool clean and uninstall mode
6926 modename
="$modename: $mode"
6932 # This variable tells wrapper scripts just to set variables rather
6933 # than running their programs.
6934 libtool_install_magic
="$magic"
6939 -f) rm="$rm $arg"; rmforce
=yes ;;
6940 -*) rm="$rm $arg" ;;
6941 *) files
="$files $arg" ;;
6945 if test -z "$rm"; then
6946 $echo "$modename: you must specify an RM program" 1>&2
6953 origobjdir
="$objdir"
6954 for file in $files; do
6955 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6956 if test "X$dir" = "X$file"; then
6958 objdir
="$origobjdir"
6960 objdir
="$dir/$origobjdir"
6962 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6963 test "$mode" = uninstall
&& objdir
="$dir"
6965 # Remember objdir for removal later, being careful to avoid duplicates
6966 if test "$mode" = clean
; then
6969 *) rmdirs
="$rmdirs $objdir" ;;
6973 # Don't error if the file doesn't exist and rm -f was used.
6974 if (test -L "$file") >/dev
/null
2>&1 \
6975 ||
(test -h "$file") >/dev
/null
2>&1 \
6976 ||
test -f "$file"; then
6978 elif test -d "$file"; then
6981 elif test "$rmforce" = yes; then
6989 # Possibly a libtool archive, so verify it.
6990 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6993 # Delete the libtool libraries and symlinks.
6994 for n
in $library_names; do
6995 rmfiles
="$rmfiles $objdir/$n"
6997 test -n "$old_library" && rmfiles
="$rmfiles $objdir/$old_library"
7001 case " $library_names " in
7002 # " " in the beginning catches empty $dlname
7004 *) rmfiles
="$rmfiles $objdir/$dlname" ;;
7006 test -n "$libdir" && rmfiles
="$rmfiles $objdir/$name $objdir/${name}i"
7009 if test -n "$library_names"; then
7010 # Do each command in the postuninstall commands.
7011 cmds
=$postuninstall_cmds
7012 save_ifs
="$IFS"; IFS
='~'
7013 for cmd
in $cmds; do
7018 if test "$?" -ne 0 && test "$rmforce" != yes; then
7025 if test -n "$old_library"; then
7026 # Do each command in the old_postuninstall commands.
7027 cmds
=$old_postuninstall_cmds
7028 save_ifs
="$IFS"; IFS
='~'
7029 for cmd
in $cmds; do
7034 if test "$?" -ne 0 && test "$rmforce" != yes; then
7040 # FIXME: should reinstall the best remaining shared library.
7047 # Possibly a libtool object, so verify it.
7048 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
7053 # Add PIC object to the list of files to remove.
7054 if test -n "$pic_object" \
7055 && test "$pic_object" != none
; then
7056 rmfiles
="$rmfiles $dir/$pic_object"
7059 # Add non-PIC object to the list of files to remove.
7060 if test -n "$non_pic_object" \
7061 && test "$non_pic_object" != none
; then
7062 rmfiles
="$rmfiles $dir/$non_pic_object"
7068 if test "$mode" = clean
; then
7072 file=`$echo $file|${SED} 's,.exe$,,'`
7073 noexename
=`$echo $name|${SED} 's,.exe$,,'`
7074 # $file with .exe has already been added to rmfiles,
7075 # add $file without .exe
7076 rmfiles
="$rmfiles $file"
7079 # Do a test to see if this is a libtool program.
7080 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
7084 # note $name still contains .exe if it was in $file originally
7085 # as does the version of $file that was added into $rmfiles
7086 rmfiles
="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
7087 if test "$fast_install" = yes && test -n "$relink_command"; then
7088 rmfiles
="$rmfiles $objdir/lt-$name"
7090 if test "X$noexename" != "X$name" ; then
7091 rmfiles
="$rmfiles $objdir/lt-${noexename}.c"
7097 $show "$rm $rmfiles"
7098 $run $rm $rmfiles || exit_status
=1
7100 objdir
="$origobjdir"
7102 # Try to remove the ${objdir}s in the directories where we deleted files
7103 for dir
in $rmdirs; do
7104 if test -d "$dir"; then
7106 $run rmdir $dir >/dev
/null
2>&1
7114 $echo "$modename: you must specify a MODE" 1>&2
7115 $echo "$generic_help" 1>&2
7120 if test -z "$exec_cmd"; then
7121 $echo "$modename: invalid operation mode \`$mode'" 1>&2
7122 $echo "$generic_help" 1>&2
7125 fi # test -z "$show_help"
7127 if test -n "$exec_cmd"; then
7132 # We need to display help for each of the modes.
7135 "Usage: $modename [OPTION]... [MODE-ARG]...
7137 Provide generalized library-building support services.
7139 --config show all configuration variables
7140 --debug enable verbose shell tracing
7141 -n, --dry-run display commands without modifying any files
7142 --features display basic configuration information and exit
7143 --finish same as \`--mode=finish'
7144 --help display this help message and exit
7145 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
7146 --quiet same as \`--silent'
7147 --silent don't print informational messages
7148 --tag=TAG use configuration variables from tag TAG
7149 --version print version information
7151 MODE must be one of the following:
7153 clean remove files from the build directory
7154 compile compile a source file into a libtool object
7155 execute automatically set library path, then run a program
7156 finish complete the installation of libtool libraries
7157 install install libraries or executables
7158 link create a library or an executable
7159 uninstall remove libraries from an installed directory
7161 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
7162 a more detailed description of MODE.
7164 Report bugs to <bug-libtool@gnu.org>."
7170 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
7172 Remove files from the build directory.
7174 RM is the name of the program to use to delete files associated with each FILE
7175 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
7178 If FILE is a libtool library, object or program, all the files associated
7179 with it are deleted. Otherwise, only FILE itself is deleted using RM."
7184 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
7186 Compile a source file into a libtool library object.
7188 This mode accepts the following additional options:
7190 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
7191 -prefer-pic try to building PIC objects only
7192 -prefer-non-pic try to building non-PIC objects only
7193 -static always build a \`.o' file suitable for static linking
7195 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
7196 from the given SOURCEFILE.
7198 The output file name is determined by removing the directory component from
7199 SOURCEFILE, then substituting the C source code suffix \`.c' with the
7200 library object suffix, \`.lo'."
7205 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
7207 Automatically set library path, then run a program.
7209 This mode accepts the following additional options:
7211 -dlopen FILE add the directory containing FILE to the library path
7213 This mode sets the library path environment variable according to \`-dlopen'
7216 If any of the ARGS are libtool executable wrappers, then they are translated
7217 into their corresponding uninstalled binary, and any of their required library
7218 directories are added to the library path.
7220 Then, COMMAND is executed, with ARGS as arguments."
7225 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
7227 Complete the installation of libtool libraries.
7229 Each LIBDIR is a directory that contains libtool libraries.
7231 The commands that this mode executes may require superuser privileges. Use
7232 the \`--dry-run' option if you just want to see what would be executed."
7237 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
7239 Install executables or libraries.
7241 INSTALL-COMMAND is the installation command. The first component should be
7242 either the \`install' or \`cp' program.
7244 The rest of the components are interpreted as arguments to that command (only
7245 BSD-compatible install options are recognized)."
7250 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
7252 Link object files or libraries together to form another library, or to
7253 create an executable program.
7255 LINK-COMMAND is a command using the C compiler that you would use to create
7256 a program from several object files.
7258 The following components of LINK-COMMAND are treated specially:
7260 -all-static do not do any dynamic linking at all
7261 -avoid-version do not add a version suffix if possible
7262 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
7263 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
7264 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
7265 -export-symbols SYMFILE
7266 try to export only the symbols listed in SYMFILE
7267 -export-symbols-regex REGEX
7268 try to export only the symbols matching REGEX
7269 -LLIBDIR search LIBDIR for required installed libraries
7270 -lNAME OUTPUT-FILE requires the installed library libNAME
7271 -module build a library that can dlopened
7272 -no-fast-install disable the fast-install mode
7273 -no-install link a not-installable executable
7274 -no-undefined declare that a library does not refer to external symbols
7275 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
7276 -objectlist FILE Use a list of object files found in FILE to specify objects
7277 -precious-files-regex REGEX
7278 don't remove output files matching REGEX
7279 -release RELEASE specify package release information
7280 -rpath LIBDIR the created library will eventually be installed in LIBDIR
7281 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
7282 -static do not do any dynamic linking of libtool libraries
7283 -version-info CURRENT[:REVISION[:AGE]]
7284 specify library version info [each variable defaults to 0]
7286 All other options (arguments beginning with \`-') are ignored.
7288 Every other argument is treated as a filename. Files ending in \`.la' are
7289 treated as uninstalled libtool libraries, other files are standard or library
7292 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
7293 only library objects (\`.lo' files) may be specified, and \`-rpath' is
7294 required, except when creating a convenience library.
7296 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
7297 using \`ar' and \`ranlib', or on Windows using \`lib'.
7299 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
7300 is created, otherwise an executable program is created."
7305 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
7307 Remove libraries from an installation directory.
7309 RM is the name of the program to use to delete files associated with each FILE
7310 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
7313 If FILE is a libtool library, all the files associated with it are deleted.
7314 Otherwise, only FILE itself is deleted using RM."
7318 $echo "$modename: invalid operation mode \`$mode'" 1>&2
7325 $echo "Try \`$modename --help' for more information about other modes."
7329 # The TAGs below are defined such that we never get into a situation
7330 # in which we disable both kinds of libraries. Given conflicting
7331 # choices, we go for a static library, that is the most portable,
7332 # since we can't tell whether shared libraries were disabled because
7333 # the user asked for that or because the platform doesn't support
7334 # them. This is particularly important on AIX, because we don't
7335 # support having both static and shared libraries enabled at the same
7336 # time on that platform, so we default to a shared-only configuration.
7337 # If a disable-shared tag is given, we'll fallback to a static-only
7338 # configuration. But we'll never go from static-only to shared-only.
7340 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
7342 # ### END LIBTOOL TAG CONFIG: disable-shared
7344 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
7346 # ### END LIBTOOL TAG CONFIG: disable-static