3 # libtoolT - Provide generalized library-building support services.
4 # Generated automatically by (GNU ltt-control 0.24-17092006)
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 ubuntujov:
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.
69 host=i686-pc-linux-gnu
74 build
=i686-pc-linux-gnu
77 # An echo program that does not interpret backslashes.
87 # LTCC compiler flags.
90 # A language-specific compiler.
93 # Is the compiler the GNU C compiler?
99 # The linker used to build libraries.
102 # Whether we need hard or soft links.
105 # A BSD-compatible nm program.
108 # A symbol stripping program
111 # Used to examine libraries when file_magic_cmd begins "file"
114 # Used on cygwin: DLL creation program.
117 # Used on cygwin: object dumper.
120 # Used on cygwin: assembler.
123 # The name of the directory that contains temporary libtool files.
126 # How to create reloadable object files.
128 reload_cmds
="\$LD\$reload_flag -o \$output\$reload_objs"
130 # How to pass a linker flag through the compiler.
133 # Object file suffix (normally "o").
136 # Old archive suffix (normally "a").
139 # Shared library suffix (normally ".so").
142 # Executable file suffix (normally "").
145 # Additional compiler flags for building library objects.
146 pic_flag
=" -fPIC -DPIC"
149 # What is the maximum length of a command?
152 # Does compiler simultaneously support -c and -o options?
155 # Must we lock files when doing compilation?
158 # Do we need the lib prefix for modules?
161 # Do we need a version for libraries?
164 # Whether dlopen is supported.
165 dlopen_support
=unknown
167 # Whether dlopen of programs is supported.
170 # Whether dlopen of statically linked programs is supported.
171 dlopen_self_static
=unknown
173 # Compiler flag to prevent dynamic linking.
174 link_static_flag
="-static"
176 # Compiler flag to turn off builtin functions.
177 no_builtin_flag
=" -fno-builtin"
179 # Compiler flag to allow reflexive dlopens.
180 export_dynamic_flag_spec
="\${wl}--export-dynamic"
182 # Compiler flag to generate shared objects directly from archives.
183 whole_archive_flag_spec
="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
185 # Compiler flag to generate thread-safe objects.
186 thread_safe_flag_spec
=""
188 # Library versioning type.
191 # Format of library name prefix.
192 libname_spec
="lib\$name"
194 # List of archive names. First name is the real one, the rest are links.
195 # The last name is the one that the linker finds with -lNAME.
196 library_names_spec
="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
198 # The coded name of the library, if different from the real name.
199 soname_spec
="\${libname}\${release}\${shared_ext}\$major"
201 # Commands used to build and install an old-style archive.
203 old_archive_cmds
="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
204 old_postinstall_cmds
="chmod 644 \$oldlib~\$RANLIB \$oldlib"
205 old_postuninstall_cmds
=""
207 # Create an old-style archive from a shared archive.
208 old_archive_from_new_cmds
=""
210 # Create a temporary old-style archive to link instead of a shared archive.
211 old_archive_from_expsyms_cmds
=""
213 # Commands used to build and install a shared archive.
214 archive_cmds
="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
215 archive_expsym_cmds
="\$echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
216 cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
217 \$echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
218 \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
220 postuninstall_cmds
=""
222 # Commands used to build a loadable module (assumed same as above if empty)
224 module_expsym_cmds
=""
226 # Commands to strip libraries.
227 old_striplib
="strip --strip-debug"
228 striplib
="strip --strip-unneeded"
230 # Dependencies to place before the objects being linked to create a
234 # Dependencies to place after the objects being linked to create a
238 # Dependencies to place before the objects being linked to create a
242 # Dependencies to place after the objects being linked to create a
246 # The library search path used internally by the compiler when linking
248 compiler_lib_search_path
=""
250 # Method to check whether dependent libraries are shared objects.
251 deplibs_check_method
="pass_all"
253 # Command to use when deplibs_check_method == file_magic.
254 file_magic_cmd
="\$MAGIC_CMD"
256 # Flag that allows shared libraries with undefined symbols to be built.
257 allow_undefined_flag
=""
259 # Flag that forces no undefined symbols.
262 # Commands used to finish a libtool library installation in a directory.
263 finish_cmds
="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
265 # Same as above, but a single script fragment to be evaled but not shown.
268 # Take the output of nm and produce a listing of raw symbols and C names.
269 global_symbol_pipe
="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
271 # Transform the output of nm in a proper C declaration
272 global_symbol_to_cdecl
="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
274 # Transform the output of nm in a C name address pair
275 global_symbol_to_c_name_address
="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
277 # This is the shared library runtime path variable.
278 runpath_var
=LD_RUN_PATH
280 # This is the shared library path variable.
281 shlibpath_var
=LD_LIBRARY_PATH
283 # Is shlibpath searched before the hard-coded library search path?
284 shlibpath_overrides_runpath
=no
286 # How to hardcode a shared library path into an executable.
287 hardcode_action
=immediate
289 # Whether we should hardcode library paths into libraries.
290 hardcode_into_libs
=yes
292 # Flag to hardcode $libdir into a binary during linking.
293 # This must work even if $libdir does not exist.
294 hardcode_libdir_flag_spec
="\${wl}--rpath \${wl}\$libdir"
296 # If ld is used when linking, flag to hardcode $libdir into
297 # a binary during linking. This must work even if $libdir does
299 hardcode_libdir_flag_spec_ld
=""
301 # Whether we need a single -rpath flag with a separated argument.
302 hardcode_libdir_separator
=""
304 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
308 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
312 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
313 # the resulting binary.
314 hardcode_shlibpath_var
=unsupported
316 # Set to yes if building a shared library automatically hardcodes DIR into the library
317 # and all subsequent libraries and executables linked against it.
318 hardcode_automatic
=no
320 # Variables whose values should be saved in libtool wrapper scripts and
321 # restored at relink time.
322 variables_saved_for_relink
="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
324 # Whether libtool must link a program against all its dependency libraries.
327 # Compile-time system search path for libraries
328 sys_lib_search_path_spec
=" /usr/lib/gcc/i486-linux-gnu/4.0.3/ /usr/lib/gcc/i486-linux-gnu/4.0.3/ /usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../i486-linux-gnu/lib/i486-linux-gnu/4.0.3/ /usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../i486-linux-gnu/lib/ /usr/lib/gcc/i486-linux-gnu/4.0.3/../../../i486-linux-gnu/4.0.3/ /usr/lib/gcc/i486-linux-gnu/4.0.3/../../../ /lib/i486-linux-gnu/4.0.3/ /lib/ /usr/lib/i486-linux-gnu/4.0.3/ /usr/lib/"
330 # Run-time system search path for libraries
331 sys_lib_dlsearch_path_spec
="/lib /usr/lib"
333 # Fix the shell variable $srcfile for the compiler.
336 # Set to yes if exported symbols are required.
337 always_export_symbols
=no
339 # The commands to list exported symbols.
340 export_symbols_cmds
="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
342 # The commands to extract the exported symbol list from a shared archive.
343 extract_expsyms_cmds
=""
345 # Symbols that should not be listed in the preloaded symbols.
346 exclude_expsyms
="_GLOBAL_OFFSET_TABLE_"
348 # Symbols that must always be exported.
351 # ### END LIBTOOL CONFIG
353 # ltmain.sh - Provide generalized library-building support services.
354 # NOTE: Changing this file will not affect anything until you rerun configure.
356 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
357 # Free Software Foundation, Inc.
358 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
360 # This program is free software; you can redistribute it and/or modify
361 # it under the terms of the GNU General Public License as published by
362 # the Free Software Foundation; either version 2 of the License, or
363 # (at your option) any later version.
365 # This program is distributed in the hope that it will be useful, but
366 # WITHOUT ANY WARRANTY; without even the implied warranty of
367 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
368 # General Public License for more details.
370 # You should have received a copy of the GNU General Public License
371 # along with this program; if not, write to the Free Software
372 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
374 # As a special exception to the GNU General Public License, if you
375 # distribute this file as part of a program that contains a
376 # configuration script generated by Autoconf, you may include it under
377 # the same distribution terms that you use for the rest of that program.
381 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
382 # is ksh but when the shell is invoked as "sh" and the current value of
383 # the _XPG environment variable is not equal to 1 (one), the special
384 # positional parameter $0, within a function call, is the name of the
388 # The name of this program:
389 progname
=`echo "$progpath" | $SED $basename`
398 VERSION
="1.5.22 Debian 1.5.22-4"
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
407 # Check that we have a working $echo.
408 if test "X$1" = X--no-reexec
; then
409 # Discard the --no-reexec flag, and continue.
411 elif test "X$1" = X--fallback-echo
; then
412 # Avoid inline document here, it may be left over
414 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
415 # Yippee, $echo works!
418 # Restart under the correct shell, and then maybe $echo will work.
419 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
422 if test "X$1" = X--fallback-echo
; then
423 # used as fallback echo
432 help="Try \`$progname --help' for more information."
433 magic
="%%%MAGIC variable%%%"
438 # Sed substitution that helps us do robust quoting. It backslashifies
439 # metacharacters that are still active within double-quoted strings.
440 Xsed
="${SED}"' -e 1s/^X//'
441 sed_quote_subst
='s/\([\\`\\"$\\\\]\)/\\\1/g'
442 # test EBCDIC or ASCII
443 case `echo X|tr X '\101'` in
444 A
) # ASCII based system
445 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
447 NL2SP
='tr \015\012 \040\040'
449 *) # EBCDIC based system
451 NL2SP
='tr \r\n \100\100'
456 # Only set LANG and LC_ALL to C if already set.
457 # These must not be set unconditionally because not all systems understand
458 # e.g. LANG=C (notably SCO).
459 # We save the old values to restore during execute mode.
460 if test "${LC_ALL+set}" = set; then
461 save_LC_ALL
="$LC_ALL"; LC_ALL
=C
; export LC_ALL
463 if test "${LANG+set}" = set; then
464 save_LANG
="$LANG"; LANG
=C
; export LANG
467 # Make sure IFS has a sensible default
472 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
473 $echo "$modename: not configured to build any kind of library" 1>&2
474 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
489 lo2o
="s/\\.lo\$/.${objext}/"
490 o2lo
="s/\\.${objext}\$/.lo/"
492 #####################################
493 # Shell function definitions:
494 # This seems to be the best place for them
496 # func_mktempdir [string]
497 # Make a temporary directory that won't clash with other running
498 # libtool processes, and avoids race conditions if possible. If
499 # given, STRING is the basename for that directory.
502 my_template
="${TMPDIR-/tmp}/${1-$progname}"
504 if test "$run" = ":"; then
505 # Return a directory name, but don't create it in dry-run mode
506 my_tmpdir
="${my_template}-$$"
509 # If mktemp works, use that first and foremost
510 my_tmpdir
=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
512 if test ! -d "$my_tmpdir"; then
513 # Failing that, at least try and use $RANDOM to avoid a race
514 my_tmpdir
="${my_template}-${RANDOM-0}$$"
516 save_mktempdir_umask
=`umask`
519 umask $save_mktempdir_umask
522 # If we're not in dry-run mode, bomb out on failure
523 test -d "$my_tmpdir" ||
{
524 $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
529 $echo "X$my_tmpdir" |
$Xsed
533 # func_win32_libid arg
534 # return the library type of file 'arg'
536 # Need a lot of goo to handle *both* DLLs and import libs
537 # Has to be a shell function in order to 'eat' the argument
538 # that is supplied when $file_magic_command is called.
541 win32_libid_type
="unknown"
542 win32_fileres
=`file -L $1 2>/dev/null`
543 case $win32_fileres in
544 *ar\ archive\ import\ library
*) # definitely import
545 win32_libid_type
="x86 archive import"
547 *ar\ archive
*) # could be an import, or static
548 if eval $OBJDUMP -f $1 |
$SED -e '10q' 2>/dev
/null | \
549 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev
/null
; then
550 win32_nmres
=`eval $NM -f posix -A $1 | \
551 $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
553 import
*) win32_libid_type
="x86 archive import";;
554 *) win32_libid_type
="x86 archive static";;
559 win32_libid_type
="x86 DLL"
561 *executable
*) # but shell scripts are "executable" too...
562 case $win32_fileres in
563 *MS\ Windows\ PE\ Intel
*)
564 win32_libid_type
="x86 DLL"
569 $echo $win32_libid_type
574 # Infer tagged configuration to use if any are available and
575 # if one wasn't chosen via the "--tag" command line option.
576 # Only attempt this if the compiler in the base compile
577 # command doesn't match the default compiler.
578 # arg is usually of the form 'gcc ...'
581 if test -n "$available_tags" && test -z "$tagname"; then
585 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
589 CC_quoted
="$CC_quoted $arg"
592 # Blanks in the command may have been stripped by the calling shell,
593 # but not from the CC environment variable when configure was run.
594 " $CC "* |
"$CC "* |
" `$echo $CC` "* |
"`$echo $CC` "* |
" $CC_quoted"* |
"$CC_quoted "* |
" `$echo $CC_quoted` "* |
"`$echo $CC_quoted` "*) ;;
595 # Blanks at the start of $base_compile will cause this to fail
596 # if we don't check for them as well.
598 for z
in $available_tags; do
599 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev
/null
; then
600 # Evaluate the configuration.
601 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
604 # Double-quote args containing other shell metacharacters.
606 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
610 CC_quoted
="$CC_quoted $arg"
613 " $CC "* |
"$CC "* |
" `$echo $CC` "* |
"`$echo $CC` "* |
" $CC_quoted"* |
"$CC_quoted "* |
" `$echo $CC_quoted` "* |
"`$echo $CC_quoted` "*)
614 # The compiler in the base compile command matches
615 # the one in the tagged configuration.
616 # Assume this is the tagged configuration we want.
623 # If $tagname still isn't set, then no tagged configuration
624 # was found and let the user know that the "--tag" command
625 # line option must be used.
626 if test -z "$tagname"; then
627 $echo "$modename: unable to infer tagged configuration"
628 $echo "$modename: specify a tag with \`--tag'" 1>&2
631 # $echo "$modename: using $tagname tagged configuration"
639 # func_extract_an_archive dir oldlib
640 func_extract_an_archive
()
642 f_ex_an_ar_dir
="$1"; shift
643 f_ex_an_ar_oldlib
="$1"
645 $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
646 $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" ||
exit $?
647 if ($AR t
"$f_ex_an_ar_oldlib" |
sort |
sort -uc >/dev
/null
2>&1); then
650 $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
655 # func_extract_archives gentop oldlib ...
656 func_extract_archives
()
658 my_gentop
="$1"; shift
666 $show "${rm}r $my_gentop"
667 $run ${rm}r
"$my_gentop"
668 $show "$mkdir $my_gentop"
669 $run $mkdir "$my_gentop"
671 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
675 for my_xlib
in $my_oldlibs; do
676 # Extract the objects.
678 [\\/]* |
[A-Za-z
]:[\\/]*) my_xabs
="$my_xlib" ;;
679 *) my_xabs
=`pwd`"/$my_xlib" ;;
681 my_xlib
=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
682 my_xdir
="$my_gentop/$my_xlib"
684 $show "${rm}r $my_xdir"
685 $run ${rm}r
"$my_xdir"
686 $show "$mkdir $my_xdir"
687 $run $mkdir "$my_xdir"
689 if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
694 $show "Extracting $my_xabs"
695 # Do not bother doing anything if just a dry run
696 if test -z "$run"; then
697 darwin_orig_dir
=`pwd`
698 cd $my_xdir ||
exit $?
699 darwin_archive
=$my_xabs
701 darwin_base_archive
=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
702 darwin_arches
=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
703 if test -n "$darwin_arches"; then
704 darwin_arches
=`echo "$darwin_arches" | $SED -e 's/.*are://'`
706 $show "$darwin_base_archive has multiple architectures $darwin_arches"
707 for darwin_arch
in $darwin_arches ; do
708 mkdir
-p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
709 lipo
-thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
710 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
711 func_extract_an_archive
"`pwd`" "${darwin_base_archive}"
713 $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
714 done # $darwin_arches
715 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
716 darwin_filelist
=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
719 for darwin_file
in $darwin_filelist; do
720 darwin_files
=`find unfat-$$ -name $darwin_file -print | $NL2SP`
721 lipo
-create -output "$darwin_file" $darwin_files
722 done # $darwin_filelist
724 cd "$darwin_orig_dir"
726 cd "$darwin_orig_dir"
727 func_extract_an_archive
"$my_xdir" "$my_xabs"
732 func_extract_an_archive
"$my_xdir" "$my_xabs"
735 my_oldobjs
="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
737 func_extract_archives_result
="$my_oldobjs"
739 # End of Shell function definitions
740 #####################################
743 eval std_shrext
=\"$shrext_cmds\"
747 # Parse our command line options once, thoroughly.
748 while test "$#" -gt 0
754 -*=*) optarg
=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
758 # If the previous option needs an argument, assign it.
759 if test -n "$prev"; then
762 execute_dlfiles
="$execute_dlfiles $arg"
766 preserve_args
="${preserve_args}=$arg"
768 # Check whether tagname contains only valid characters
771 $echo "$progname: invalid tag name: $tagname" 1>&2
778 # Don't test for the "default" C tag, as we know, it's there, but
779 # not specially marked.
782 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev
/null
; then
783 taglist
="$taglist $tagname"
784 # Evaluate the configuration.
785 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
787 $echo "$progname: ignoring unknown tag $tagname" 1>&2
802 # Have we seen a non-optional argument yet?
809 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
811 $echo "Copyright (C) 2005 Free Software Foundation, Inc."
812 $echo "This is free software; see the source for copying conditions. There is NO"
813 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
818 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
819 # Now print the configurations for the tags.
820 for tagname
in $taglist; do
821 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
827 $echo "$progname: enabling shell trace mode"
829 preserve_args
="$preserve_args $arg"
838 if test "$build_libtool_libs" = yes; then
839 $echo "enable shared libraries"
841 $echo "disable shared libraries"
843 if test "$build_old_libs" = yes; then
844 $echo "enable static libraries"
846 $echo "disable static libraries"
851 --finish) mode
="finish" ;;
853 --mode) prevopt
="--mode" prev
=mode
;;
854 --mode=*) mode
="$optarg" ;;
856 --preserve-dup-deps) duplicate_deps
="yes" ;;
860 preserve_args
="$preserve_args $arg"
866 preserve_args
="$preserve_args --tag"
869 set tag
"$optarg" ${1+"$@"}
872 preserve_args
="$preserve_args --tag"
881 $echo "$modename: unrecognized option \`$arg'" 1>&2
893 if test -n "$prevopt"; then
894 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
899 case $disable_libs in
903 build_libtool_libs
=no
907 build_old_libs
=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
911 # If this variable is set in any of the actions, the command in it
912 # will be execed at the end. This prevents here-documents from being
913 # left over by shells.
916 if test -z "$show_help"; then
918 # Infer the operation mode.
919 if test -z "$mode"; then
920 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
921 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
923 *cc | cc
* |
*++ | gcc
* |
*-gcc* | g
++* | xlc
*)
935 *db |
*dbx |
*strace |
*truss
)
945 # If we have no mode, but dlfiles were specified, then do execute mode.
946 test -n "$execute_dlfiles" && mode
=execute
948 # Just use the default operation mode.
949 if test -z "$mode"; then
950 if test -n "$nonopt"; then
951 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
953 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
960 # Only execute mode is allowed to have -dlopen flags.
961 if test -n "$execute_dlfiles" && test "$mode" != execute
; then
962 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
967 # Change the help message to a mode-specific one.
969 help="Try \`$modename --help --mode=$mode' for more information."
971 # These modes are in order of execution frequency so that they run quickly.
973 # libtool compile mode
975 modename
="$modename: compile"
976 # Get the compilation command and the source file.
978 srcfile
="$nonopt" # always keep a non-empty value in "srcfile"
989 # do not "continue". Instead, add this to base_compile
1001 # Accept any command-line options.
1004 if test -n "$libobj" ; then
1005 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
1012 -static |
-prefer-pic |
-prefer-non-pic)
1023 arg_mode
=arg
# the next one goes into the "base_compile" arg list
1024 continue # The current "srcfile" will either be retained or
1025 ;; # replaced later. I would guess that would be a bug.
1028 args
=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
1030 save_ifs
="$IFS"; IFS
=','
1031 for arg
in $args; do
1034 # Double-quote args containing other shell metacharacters.
1035 # Many Bourne shells cannot handle close brackets correctly
1036 # in scan sets, so we specify it separately.
1038 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1042 lastarg
="$lastarg $arg"
1045 lastarg
=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
1047 # Add the arguments to base_compile.
1048 base_compile
="$base_compile $lastarg"
1053 # Accept the current argument as the source file.
1054 # The previous "srcfile" becomes the current argument.
1061 esac # case $arg_mode
1063 # Aesthetically quote the previous argument.
1064 lastarg
=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
1067 # Double-quote args containing other shell metacharacters.
1068 # Many Bourne shells cannot handle close brackets correctly
1069 # in scan sets, and some SunOS ksh mistreat backslash-escaping
1070 # in scan sets (worked around with variable expansion),
1071 # and furthermore cannot handle '|' '&' '(' ')' in scan sets
1072 # at all, so we specify them separately.
1073 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1074 lastarg
="\"$lastarg\""
1078 base_compile
="$base_compile $lastarg"
1083 $echo "$modename: you must specify an argument for -Xcompile"
1087 $echo "$modename: you must specify a target with \`-o'" 1>&2
1091 # Get the name of the library object.
1092 [ -z "$libobj" ] && libobj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
1096 # Recognize several different file suffixes.
1097 # If the user specifies -o file.o, it is replaced with file.lo
1107 *.class
) xform
=class
;;
1112 *.java
) xform
=java
;;
1115 libobj
=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
1118 *.lo
) obj
=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
1120 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
1125 func_infer_tag
$base_compile
1127 for arg
in $later; do
1146 qlibobj
=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
1148 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1149 qlibobj
="\"$qlibobj\"" ;;
1151 test "X$libobj" != "X$qlibobj" \
1152 && $echo "X$libobj" |
grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
1153 && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
1154 objname
=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
1155 xdir
=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
1156 if test "X$xdir" = "X$obj"; then
1161 lobj
=${xdir}$objdir/$objname
1163 if test -z "$base_compile"; then
1164 $echo "$modename: you must specify a compilation command" 1>&2
1169 # Delete any leftover library objects.
1170 if test "$build_old_libs" = yes; then
1171 removelist
="$obj $lobj $libobj ${libobj}T"
1173 removelist
="$lobj $libobj ${libobj}T"
1176 $run $rm $removelist
1177 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1179 # On Cygwin there's no "real" PIC flag so we must build both object types
1181 cygwin
* | mingw
* | pw32
* | os2
*)
1185 if test "$pic_mode" = no
&& test "$deplibs_check_method" != pass_all
; then
1186 # non-PIC code in shared libraries is not supported
1190 # Calculate the filename of the output object if compiler does
1191 # not support -o with -c
1192 if test "$compiler_c_o" = no
; then
1193 output_obj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.
${objext}
1194 lockfile
="$output_obj.lock"
1195 removelist
="$removelist $output_obj $lockfile"
1196 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1203 # Lock this critical section if it is needed
1204 # We use this script file to make the link, it avoids creating a new file
1205 if test "$need_locks" = yes; then
1206 until $run ln "$progpath" "$lockfile" 2>/dev
/null
; do
1207 $show "Waiting for $lockfile to be removed"
1210 elif test "$need_locks" = warn
; then
1211 if test -f "$lockfile"; then
1213 *** ERROR, $lockfile exists and contains:
1214 `cat $lockfile 2>/dev/null`
1216 This indicates that another process is trying to use the same
1217 temporary object file, and libtool could not work around it because
1218 your compiler does not support \`-c' and \`-o' together. If you
1219 repeat this compilation, it may succeed, by chance, but you had better
1220 avoid parallel builds (make -j) in this platform, or get a better
1223 $run $rm $removelist
1226 $echo "$srcfile" > "$lockfile"
1229 if test -n "$fix_srcfile_path"; then
1230 eval srcfile
=\"$fix_srcfile_path\"
1232 qsrcfile
=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
1234 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1235 qsrcfile
="\"$qsrcfile\"" ;;
1238 $run $rm "$libobj" "${libobj}T"
1240 # Create a libtool object file (analogous to a ".la" file),
1241 # but don't create it if we're doing a dry run.
1242 test -z "$run" && cat > ${libobj}T
<<EOF
1243 # $libobj - a libtool object file
1244 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
1246 # Please DO NOT delete this file!
1247 # It is necessary for linking the library.
1249 # Name of the PIC object.
1252 # Only build a PIC object if we are building libtool libraries.
1253 if test "$build_libtool_libs" = yes; then
1254 # Without this assignment, base_compile gets emptied.
1255 fbsd_hideous_sh_bug
=$base_compile
1257 if test "$pic_mode" != no
; then
1258 command="$base_compile $qsrcfile $pic_flag"
1260 # Don't build PIC code
1261 command="$base_compile $qsrcfile"
1264 if test ! -d "${xdir}$objdir"; then
1265 $show "$mkdir ${xdir}$objdir"
1266 $run $mkdir ${xdir}$objdir
1268 if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
1273 if test -z "$output_obj"; then
1274 # Place PIC objects in $objdir
1275 command="$command -o $lobj"
1278 $run $rm "$lobj" "$output_obj"
1281 if $run eval "$command"; then :
1283 test -n "$output_obj" && $run $rm $removelist
1287 if test "$need_locks" = warn
&&
1288 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1290 *** ERROR, $lockfile contains:
1291 `cat $lockfile 2>/dev/null`
1293 but it should contain:
1296 This indicates that another process is trying to use the same
1297 temporary object file, and libtool could not work around it because
1298 your compiler does not support \`-c' and \`-o' together. If you
1299 repeat this compilation, it may succeed, by chance, but you had better
1300 avoid parallel builds (make -j) in this platform, or get a better
1303 $run $rm $removelist
1307 # Just move the object if needed, then go on to compile the next one
1308 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1309 $show "$mv $output_obj $lobj"
1310 if $run $mv $output_obj $lobj; then :
1313 $run $rm $removelist
1318 # Append the name of the PIC object to the libtool object file.
1319 test -z "$run" && cat >> ${libobj}T
<<EOF
1320 pic_object='$objdir/$objname'
1324 # Allow error messages only from the first compilation.
1325 if test "$suppress_opt" = yes; then
1326 suppress_output
=' >/dev/null 2>&1'
1329 # No PIC object so indicate it doesn't exist in the libtool
1331 test -z "$run" && cat >> ${libobj}T
<<EOF
1337 # Only build a position-dependent object if we build old libraries.
1338 if test "$build_old_libs" = yes; then
1339 if test "$pic_mode" != yes; then
1340 # Don't build PIC code
1341 command="$base_compile $qsrcfile"
1343 command="$base_compile $qsrcfile $pic_flag"
1345 if test "$compiler_c_o" = yes; then
1346 command="$command -o $obj"
1349 # Suppress compiler output if we already did a PIC compilation.
1350 command="$command$suppress_output"
1351 $run $rm "$obj" "$output_obj"
1353 if $run eval "$command"; then :
1355 $run $rm $removelist
1359 if test "$need_locks" = warn
&&
1360 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1362 *** ERROR, $lockfile contains:
1363 `cat $lockfile 2>/dev/null`
1365 but it should contain:
1368 This indicates that another process is trying to use the same
1369 temporary object file, and libtool could not work around it because
1370 your compiler does not support \`-c' and \`-o' together. If you
1371 repeat this compilation, it may succeed, by chance, but you had better
1372 avoid parallel builds (make -j) in this platform, or get a better
1375 $run $rm $removelist
1379 # Just move the object if needed
1380 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1381 $show "$mv $output_obj $obj"
1382 if $run $mv $output_obj $obj; then :
1385 $run $rm $removelist
1390 # Append the name of the non-PIC object the libtool object file.
1391 # Only append if the libtool object file exists.
1392 test -z "$run" && cat >> ${libobj}T
<<EOF
1393 # Name of the non-PIC object.
1394 non_pic_object='$objname'
1398 # Append the name of the non-PIC object the libtool object file.
1399 # Only append if the libtool object file exists.
1400 test -z "$run" && cat >> ${libobj}T
<<EOF
1401 # Name of the non-PIC object.
1407 $run $mv "${libobj}T" "${libobj}"
1409 # Unlock the critical section if it was locked
1410 if test "$need_locks" != no
; then
1411 $run $rm "$lockfile"
1419 modename
="$modename: link"
1421 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1422 # It is impossible to link a dll without this setting, and
1423 # we shouldn't force the makefile maintainer to figure out
1424 # which system we are compiling for in order to pass an extra
1425 # flag for every libtool invocation.
1426 # allow_undefined=no
1428 # FIXME: Unfortunately, there are problems with the above when trying
1429 # to make a dll which has undefined symbols, in which case not
1430 # even a static library is built. For now, we need to specify
1431 # -no-undefined on the libtool link line when we can be certain
1432 # that all symbols are satisfied, otherwise we get a static library.
1439 libtool_args
="$nonopt"
1440 base_compile
="$nonopt $@"
1441 compile_command
="$nonopt"
1442 finalize_command
="$nonopt"
1455 lib_search_path
=`pwd`
1464 export_symbols_regex
=
1472 notinst_path
= # paths that contain not-installed libtool libraries
1473 precious_files_regex
=
1474 prefer_static_libs
=no
1487 func_infer_tag
$base_compile
1489 # We need to know -static, to get the right output filenames.
1493 -all-static |
-static)
1494 if test "X$arg" = "X-all-static"; then
1495 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1496 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1498 if test -n "$link_static_flag"; then
1499 dlopen_self
=$dlopen_self_static
1501 prefer_static_libs
=yes
1503 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1504 dlopen_self
=$dlopen_self_static
1506 prefer_static_libs
=built
1508 build_libtool_libs
=no
1515 # See if our shared archives depend on static archives.
1516 test -n "$old_archive_from_new_cmds" && build_old_libs
=yes
1518 # Go through the arguments, transforming them on the way.
1519 while test "$#" -gt 0; do
1523 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1524 qarg
=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1528 libtool_args
="$libtool_args $qarg"
1530 # If the previous option needs an argument, assign it.
1531 if test -n "$prev"; then
1534 compile_command
="$compile_command @OUTPUT@"
1535 finalize_command
="$finalize_command @OUTPUT@"
1541 if test "$preload" = no
; then
1542 # Add the symbol object into the linking commands.
1543 compile_command
="$compile_command @SYMFILE@"
1544 finalize_command
="$finalize_command @SYMFILE@"
1548 *.la |
*.lo
) ;; # We handle these cases below.
1550 if test "$dlself" = no
; then
1558 if test "$prev" = dlprefiles
; then
1560 elif test "$prev" = dlfiles
&& test "$dlopen_self" != yes; then
1570 if test "$prev" = dlfiles
; then
1571 dlfiles
="$dlfiles $arg"
1573 dlprefiles
="$dlprefiles $arg"
1581 export_symbols
="$arg"
1582 if test ! -f "$arg"; then
1583 $echo "$modename: symbol file \`$arg' does not exist"
1590 export_symbols_regex
="$arg"
1595 inst_prefix_dir
="$arg"
1600 precious_files_regex
="$arg"
1610 if test -f "$arg"; then
1613 for fil
in `cat $save_arg`
1615 # moreargs="$moreargs $fil"
1617 # A libtool-controlled object.
1619 # Check to see that this really is a libtool object.
1620 if (${SED} -e '2q' $arg |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1625 # If there is no directory component, then add one.
1627 */* |
*\\*) .
$arg ;;
1631 if test -z "$pic_object" || \
1632 test -z "$non_pic_object" ||
1633 test "$pic_object" = none
&& \
1634 test "$non_pic_object" = none
; then
1635 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1639 # Extract subdirectory from the argument.
1640 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1641 if test "X$xdir" = "X$arg"; then
1647 if test "$pic_object" != none
; then
1648 # Prepend the subdirectory the object is found in.
1649 pic_object
="$xdir$pic_object"
1651 if test "$prev" = dlfiles
; then
1652 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1653 dlfiles
="$dlfiles $pic_object"
1657 # If libtool objects are unsupported, then we need to preload.
1662 # CHECK ME: I think I busted this. -Ossama
1663 if test "$prev" = dlprefiles
; then
1664 # Preload the old-style object.
1665 dlprefiles
="$dlprefiles $pic_object"
1670 libobjs
="$libobjs $pic_object"
1675 if test "$non_pic_object" != none
; then
1676 # Prepend the subdirectory the object is found in.
1677 non_pic_object
="$xdir$non_pic_object"
1679 # A standard non-PIC object
1680 non_pic_objects
="$non_pic_objects $non_pic_object"
1681 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1682 arg
="$non_pic_object"
1685 # If the PIC object exists, use it instead.
1686 # $xdir was prepended to $pic_object above.
1687 non_pic_object
="$pic_object"
1688 non_pic_objects
="$non_pic_objects $non_pic_object"
1691 # Only an error if not doing a dry-run.
1692 if test -z "$run"; then
1693 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1698 # Extract subdirectory from the argument.
1699 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1700 if test "X$xdir" = "X$arg"; then
1706 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1707 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1708 libobjs
="$libobjs $pic_object"
1709 non_pic_objects
="$non_pic_objects $non_pic_object"
1714 $echo "$modename: link input file \`$save_arg' does not exist"
1722 # We need an absolute path.
1724 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1726 $echo "$modename: only absolute run-paths are allowed" 1>&2
1730 if test "$prev" = rpath
; then
1733 *) rpath
="$rpath $arg" ;;
1738 *) xrpath
="$xrpath $arg" ;;
1745 compiler_flags
="$compiler_flags $qarg"
1747 compile_command
="$compile_command $qarg"
1748 finalize_command
="$finalize_command $qarg"
1752 linker_flags
="$linker_flags $qarg"
1753 compiler_flags
="$compiler_flags $wl$qarg"
1755 compile_command
="$compile_command $wl$qarg"
1756 finalize_command
="$finalize_command $wl$qarg"
1760 linker_flags
="$linker_flags $qarg"
1761 compiler_flags
="$compiler_flags $qarg"
1763 compile_command
="$compile_command $qarg"
1764 finalize_command
="$finalize_command $qarg"
1772 darwin_framework|darwin_framework_skip
)
1773 test "$prev" = "darwin_framework" && compiler_flags
="$compiler_flags $arg"
1774 compile_command
="$compile_command $arg"
1775 finalize_command
="$finalize_command $arg"
1780 eval "$prev=\"\$arg\""
1785 fi # test -n "$prev"
1791 if test -n "$link_static_flag"; then
1792 compile_command
="$compile_command $link_static_flag"
1793 finalize_command
="$finalize_command $link_static_flag"
1799 # FIXME: remove this flag sometime in the future.
1800 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1824 -export-symbols |
-export-symbols-regex)
1825 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
1826 $echo "$modename: more than one -exported-symbols argument is not allowed"
1829 if test "X$arg" = "X-export-symbols"; then
1837 -framework|
-arch|
-isysroot)
1839 *" ${arg} ${1} "* | *" ${arg} ${1} "*)
1840 prev
=darwin_framework_skip
;;
1841 *) compiler_flags
="$compiler_flags $arg"
1842 prev
=darwin_framework
;;
1844 compile_command
="$compile_command $arg"
1845 finalize_command
="$finalize_command $arg"
1854 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1855 # so, if we see these flags be careful not to treat them like -L
1857 case $with_gcc/$host in
1858 no
/*-*-irix* |
/*-*-irix*)
1859 compile_command
="$compile_command $arg"
1860 finalize_command
="$finalize_command $arg"
1867 dir
=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1868 # We need an absolute path.
1870 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1872 absdir
=`cd "$dir" && pwd`
1873 if test -z "$absdir"; then
1874 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1876 notinst_path
="$notinst_path $dir"
1884 deplibs
="$deplibs -L$dir"
1885 lib_search_path
="$lib_search_path $dir"
1889 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1890 testbindir
=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1891 case :$dllsearchpath: in
1893 *) dllsearchpath
="$dllsearchpath:$dir";;
1895 case :$dllsearchpath: in
1896 *":$testbindir:"*) ;;
1897 *) dllsearchpath
="$dllsearchpath:$testbindir";;
1905 if test "X$arg" = "X-lc" ||
test "X$arg" = "X-lm"; then
1907 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-beos*)
1908 # These systems don't actually have a C or math library (as such)
1912 # These systems don't actually have a C library (as such)
1913 test "X$arg" = "X-lc" && continue
1915 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
1916 # Do not include libc due to us having libc/libc_r.
1917 test "X$arg" = "X-lc" && continue
1919 *-*-rhapsody* |
*-*-darwin1.
[012])
1920 # Rhapsody C and math libraries are in the System framework
1921 deplibs
="$deplibs -framework System"
1924 *-*-sco3.2v5
* |
*-*-sco5v6*)
1925 # Causes problems with __ctype
1926 test "X$arg" = "X-lc" && continue
1928 *-*-sysv4.2uw2
* |
*-*-sysv5* |
*-*-unixware* |
*-*-OpenUNIX*)
1929 # Compiler inserts libc in the correct place for threads to work
1930 test "X$arg" = "X-lc" && continue
1933 elif test "X$arg" = "X-lc_r"; then
1935 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
1936 # Do not include libc_r directly, use -pthread flag.
1941 deplibs
="$deplibs $arg"
1945 # Tru64 UNIX uses -model [arg] to determine the layout of C++
1946 # classes, name mangling, and exception handling.
1948 compile_command
="$compile_command $arg"
1949 compiler_flags
="$compiler_flags $arg"
1950 finalize_command
="$finalize_command $arg"
1955 -mt|
-mthreads|
-kthread|
-Kthread|
-pthread|
-pthreads|
--thread-safe)
1956 compiler_flags
="$compiler_flags $arg"
1957 compile_command
="$compile_command $arg"
1958 finalize_command
="$finalize_command $arg"
1967 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
1968 # -r[0-9][0-9]* specifies the processor on the SGI compiler
1969 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
1970 # +DA*, +DD* enable 64-bit mode on the HP compiler
1971 # -q* pass through compiler args for the IBM compiler
1972 # -m* pass through architecture-specific compiler args for GCC
1973 # -m*, -t[45]*, -txscale* pass through architecture-specific
1974 # compiler args for GCC
1975 # -pg pass through profiling flag for GCC
1976 # @file GCC response files
1977 -64|
-mips[0-9]|
-r[0-9][0-9]*|
-xarch=*|
-xtarget=*|
+DA
*|
+DD
*|
-q*|
-m*|
-pg| \
1978 -t[45]*|
-txscale*|@
*)
1980 # Unknown arguments in both finalize_command and compile_command need
1981 # to be aesthetically quoted because they are evaled later.
1982 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1984 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1988 compile_command
="$compile_command $arg"
1989 finalize_command
="$finalize_command $arg"
1990 compiler_flags
="$compiler_flags $arg"
2006 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
2007 # The PATH hackery in wrapper scripts is required on Windows
2008 # in order for the loader to find any dlls it needs.
2009 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
2010 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
2013 *) no_install
=yes ;;
2030 -precious-files-regex)
2051 dir
=`$echo "X$arg" | $Xsed -e 's/^-R//'`
2052 # We need an absolute path.
2054 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
2056 $echo "$modename: only absolute run-paths are allowed" 1>&2
2062 *) xrpath
="$xrpath $dir" ;;
2068 # The effects of -static are defined in a previous loop.
2069 # We used to do the same as -all-static on platforms that
2070 # didn't have a PIC flag, but the assumption that the effects
2071 # would be equivalent was wrong. It would break on at least
2072 # Digital Unix and AIX.
2092 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
2094 save_ifs
="$IFS"; IFS
=','
2095 for flag
in $args; do
2098 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2103 compiler_flags
="$compiler_flags $flag"
2106 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
2110 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
2112 save_ifs
="$IFS"; IFS
=','
2113 for flag
in $args; do
2116 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2121 compiler_flags
="$compiler_flags $wl$flag"
2122 linker_flags
="$linker_flags $flag"
2125 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
2143 # Some other compiler flag.
2145 # Unknown arguments in both finalize_command and compile_command need
2146 # to be aesthetically quoted because they are evaled later.
2147 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2149 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2156 # A standard object.
2161 # A libtool-controlled object.
2163 # Check to see that this really is a libtool object.
2164 if (${SED} -e '2q' $arg |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
2169 # If there is no directory component, then add one.
2171 */* |
*\\*) .
$arg ;;
2175 if test -z "$pic_object" || \
2176 test -z "$non_pic_object" ||
2177 test "$pic_object" = none
&& \
2178 test "$non_pic_object" = none
; then
2179 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
2183 # Extract subdirectory from the argument.
2184 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2185 if test "X$xdir" = "X$arg"; then
2191 if test "$pic_object" != none
; then
2192 # Prepend the subdirectory the object is found in.
2193 pic_object
="$xdir$pic_object"
2195 if test "$prev" = dlfiles
; then
2196 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
2197 dlfiles
="$dlfiles $pic_object"
2201 # If libtool objects are unsupported, then we need to preload.
2206 # CHECK ME: I think I busted this. -Ossama
2207 if test "$prev" = dlprefiles
; then
2208 # Preload the old-style object.
2209 dlprefiles
="$dlprefiles $pic_object"
2214 libobjs
="$libobjs $pic_object"
2219 if test "$non_pic_object" != none
; then
2220 # Prepend the subdirectory the object is found in.
2221 non_pic_object
="$xdir$non_pic_object"
2223 # A standard non-PIC object
2224 non_pic_objects
="$non_pic_objects $non_pic_object"
2225 if test -z "$pic_object" ||
test "$pic_object" = none
; then
2226 arg
="$non_pic_object"
2229 # If the PIC object exists, use it instead.
2230 # $xdir was prepended to $pic_object above.
2231 non_pic_object
="$pic_object"
2232 non_pic_objects
="$non_pic_objects $non_pic_object"
2235 # Only an error if not doing a dry-run.
2236 if test -z "$run"; then
2237 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
2242 # Extract subdirectory from the argument.
2243 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2244 if test "X$xdir" = "X$arg"; then
2250 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
2251 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
2252 libobjs
="$libobjs $pic_object"
2253 non_pic_objects
="$non_pic_objects $non_pic_object"
2260 deplibs
="$deplibs $arg"
2261 old_deplibs
="$old_deplibs $arg"
2266 # A libtool-controlled library.
2268 if test "$prev" = dlfiles
; then
2269 # This library was specified with -dlopen.
2270 dlfiles
="$dlfiles $arg"
2272 elif test "$prev" = dlprefiles
; then
2273 # The library was specified with -dlpreopen.
2274 dlprefiles
="$dlprefiles $arg"
2277 deplibs
="$deplibs $arg"
2282 # Some other compiler argument.
2284 # Unknown arguments in both finalize_command and compile_command need
2285 # to be aesthetically quoted because they are evaled later.
2286 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2288 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2295 # Now actually substitute the argument into the commands.
2296 if test -n "$arg"; then
2297 compile_command
="$compile_command $arg"
2298 finalize_command
="$finalize_command $arg"
2300 done # argument parsing loop
2302 if test -n "$prev"; then
2303 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
2308 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
2309 eval arg
=\"$export_dynamic_flag_spec\"
2310 compile_command
="$compile_command $arg"
2311 finalize_command
="$finalize_command $arg"
2315 # calculate the name of the file, without its directory
2316 outputname
=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
2317 libobjs_save
="$libobjs"
2319 if test -n "$shlibpath_var"; then
2320 # get the directories listed in $shlibpath_var
2321 eval shlib_search_path
=\
`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2325 eval sys_lib_search_path
=\"$sys_lib_search_path_spec\"
2326 eval sys_lib_dlsearch_path
=\"$sys_lib_dlsearch_path_spec\"
2328 output_objdir
=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2329 if test "X$output_objdir" = "X$output"; then
2330 output_objdir
="$objdir"
2332 output_objdir
="$output_objdir/$objdir"
2334 # Create the object directory.
2335 if test ! -d "$output_objdir"; then
2336 $show "$mkdir $output_objdir"
2337 $run $mkdir $output_objdir
2339 if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
2344 # Determine the type of output
2347 $echo "$modename: you must specify an output file" 1>&2
2351 *.
$libext) linkmode
=oldlib
;;
2352 *.lo |
*.
$objext) linkmode
=obj
;;
2353 *.la
) linkmode
=lib
;;
2354 *) linkmode
=prog
;; # Anything else should be a program.
2358 *cygwin
* |
*mingw
* |
*pw32
*)
2359 # don't eliminate duplications in $postdeps and $predeps
2360 duplicate_compiler_generated_deps
=yes
2363 duplicate_compiler_generated_deps
=$duplicate_deps
2369 # Find all interdependent deplibs by searching for libraries
2370 # that are linked more than once (e.g. -la -lb -la)
2371 for deplib
in $deplibs; do
2372 if test "X$duplicate_deps" = "Xyes" ; then
2374 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2377 libs
="$libs $deplib"
2380 if test "$linkmode" = lib
; then
2381 libs
="$predeps $libs $compiler_lib_search_path $postdeps"
2383 # Compute libraries that are listed more than once in $predeps
2384 # $postdeps and mark them as special (i.e., whose duplicates are
2385 # not to be eliminated).
2387 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2388 for pre_post_dep
in $predeps $postdeps; do
2389 case "$pre_post_deps " in
2390 *" $pre_post_dep "*) specialdeplibs
="$specialdeplibs $pre_post_deps" ;;
2392 pre_post_deps
="$pre_post_deps $pre_post_dep"
2401 need_relink
=no
# whether we're linking any uninstalled libtool libraries
2402 notinst_deplibs
= # not-installed libtool libraries
2406 for file in $dlfiles $dlprefiles; do
2410 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2422 passes
="conv scan dlopen dlpreopen link"
2427 for pass
in $passes; do
2428 if test "$linkmode,$pass" = "lib,link" ||
2429 test "$linkmode,$pass" = "prog,scan"; then
2433 if test "$linkmode" = prog
; then
2435 dlopen
) libs
="$dlfiles" ;;
2436 dlpreopen
) libs
="$dlprefiles" ;;
2438 libs
="$deplibs %DEPLIBS%"
2439 test "X$link_all_deplibs" != Xno
&& libs
="$libs $dependency_libs"
2443 if test "$pass" = dlopen
; then
2444 # Collect dlpreopened libraries
2445 save_deplibs
="$deplibs"
2448 for deplib
in $libs; do
2452 -mt|
-mthreads|
-kthread|
-Kthread|
-pthread|
-pthreads|
--thread-safe)
2453 if test "$linkmode,$pass" = "prog,link"; then
2454 compile_deplibs
="$deplib $compile_deplibs"
2455 finalize_deplibs
="$deplib $finalize_deplibs"
2457 compiler_flags
="$compiler_flags $deplib"
2462 if test "$linkmode" != lib
&& test "$linkmode" != prog
; then
2463 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2466 name
=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2467 for searchdir
in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2468 for search_ext
in .la
$std_shrext .so .a
; do
2469 # Search the libtool library
2470 lib
="$searchdir/lib${name}${search_ext}"
2471 if test -f "$lib"; then
2472 if test "$search_ext" = ".la"; then
2481 if test "$found" != yes; then
2482 # deplib doesn't seem to be a libtool library
2483 if test "$linkmode,$pass" = "prog,link"; then
2484 compile_deplibs
="$deplib $compile_deplibs"
2485 finalize_deplibs
="$deplib $finalize_deplibs"
2487 deplibs
="$deplib $deplibs"
2488 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
2491 else # deplib is a libtool library
2492 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2493 # We need to do some special things here, and not later.
2494 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2495 case " $predeps $postdeps " in
2497 if (${SED} -e '2q' $lib |
2498 grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
2502 */* |
*\\*) .
$lib ;;
2505 for l
in $old_library $library_names; do
2508 if test "X$ll" = "X$old_library" ; then # only static version available
2510 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2511 test "X$ladir" = "X$lib" && ladir
="."
2512 lib
=$ladir/$old_library
2513 if test "$linkmode,$pass" = "prog,link"; then
2514 compile_deplibs
="$deplib $compile_deplibs"
2515 finalize_deplibs
="$deplib $finalize_deplibs"
2517 deplibs
="$deplib $deplibs"
2518 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
2532 deplibs
="$deplib $deplibs"
2533 test "$pass" = conv
&& continue
2534 newdependency_libs
="$deplib $newdependency_libs"
2535 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2538 if test "$pass" = conv
; then
2539 deplibs
="$deplib $deplibs"
2542 if test "$pass" = scan
; then
2543 deplibs
="$deplib $deplibs"
2545 compile_deplibs
="$deplib $compile_deplibs"
2546 finalize_deplibs
="$deplib $finalize_deplibs"
2548 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2551 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2557 if test "$pass" = link
; then
2558 dir
=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2559 # Make sure the xrpath contains only unique directories.
2562 *) xrpath
="$xrpath $dir" ;;
2565 deplibs
="$deplib $deplibs"
2568 *.la
) lib
="$deplib" ;;
2570 if test "$pass" = conv
; then
2571 deplibs
="$deplib $deplibs"
2577 case $deplibs_check_method in
2579 set dummy
$deplibs_check_method
2580 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2581 if eval $echo \"$deplib\" 2>/dev
/null \
2583 |
$EGREP "$match_pattern_regex" > /dev
/null
; then
2591 if test "$valid_a_lib" != yes; then
2593 $echo "*** Warning: Trying to link with static lib archive $deplib."
2594 $echo "*** I have the capability to make that library automatically link in when"
2595 $echo "*** you link to this library. But I can only do this if you have a"
2596 $echo "*** shared version of the library, which you do not appear to have"
2597 $echo "*** because the file extensions .$libext of this argument makes me believe"
2598 $echo "*** that it is just a static archive that I should not used here."
2601 $echo "*** Warning: Linking the shared library $output against the"
2602 $echo "*** static library $deplib is not portable!"
2603 deplibs
="$deplib $deplibs"
2608 if test "$pass" != link
; then
2609 deplibs
="$deplib $deplibs"
2611 compile_deplibs
="$deplib $compile_deplibs"
2612 finalize_deplibs
="$deplib $finalize_deplibs"
2619 if test "$pass" = conv
; then
2620 deplibs
="$deplib $deplibs"
2621 elif test "$linkmode" = prog
; then
2622 if test "$pass" = dlpreopen ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
2623 # If there is no dlopen support or we're linking statically,
2624 # we need to preload.
2625 newdlprefiles
="$newdlprefiles $deplib"
2626 compile_deplibs
="$deplib $compile_deplibs"
2627 finalize_deplibs
="$deplib $finalize_deplibs"
2629 newdlfiles
="$newdlfiles $deplib"
2639 if test "$found" = yes ||
test -f "$lib"; then :
2641 $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
2645 # Check to see that this really is a libtool archive.
2646 if (${SED} -e '2q' $lib |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
2648 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2652 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2653 test "X$ladir" = "X$lib" && ladir
="."
2661 # If the library was installed with an old release of libtool,
2662 # it will not redefine variables installed, or shouldnotlink
2670 */* |
*\\*) .
$lib ;;
2674 if test "$linkmode,$pass" = "lib,link" ||
2675 test "$linkmode,$pass" = "prog,scan" ||
2676 { test "$linkmode" != prog
&& test "$linkmode" != lib
; }; then
2677 test -n "$dlopen" && dlfiles
="$dlfiles $dlopen"
2678 test -n "$dlpreopen" && dlprefiles
="$dlprefiles $dlpreopen"
2681 if test "$pass" = conv
; then
2682 # Only check for convenience libraries
2683 deplibs
="$lib $deplibs"
2684 if test -z "$libdir"; then
2685 if test -z "$old_library"; then
2686 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2689 # It is a libtool convenience library, so add in its objects.
2690 convenience
="$convenience $ladir/$objdir/$old_library"
2691 old_convenience
="$old_convenience $ladir/$objdir/$old_library"
2693 for deplib
in $dependency_libs; do
2694 deplibs
="$deplib $deplibs"
2695 if test "X$duplicate_deps" = "Xyes" ; then
2696 case "$tmp_libs " in
2697 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2700 tmp_libs
="$tmp_libs $deplib"
2702 elif test "$linkmode" != prog
&& test "$linkmode" != lib
; then
2703 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2710 # Get the name of the library we link against.
2712 for l
in $old_library $library_names; do
2715 if test -z "$linklib"; then
2716 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2720 # This library was specified with -dlopen.
2721 if test "$pass" = dlopen
; then
2722 if test -z "$libdir"; then
2723 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2726 if test -z "$dlname" ||
2727 test "$dlopen_support" != yes ||
2728 test "$build_libtool_libs" = no
; then
2729 # If there is no dlname, no dlopen support or we're linking
2730 # statically, we need to preload. We also need to preload any
2731 # dependent libraries so libltdl's deplib preloader doesn't
2732 # bomb out in the load deplibs phase.
2733 dlprefiles
="$dlprefiles $lib $dependency_libs"
2735 newdlfiles
="$newdlfiles $lib"
2740 # We need an absolute path.
2742 [\\/]* |
[A-Za-z
]:[\\/]*) abs_ladir
="$ladir" ;;
2744 abs_ladir
=`cd "$ladir" && pwd`
2745 if test -z "$abs_ladir"; then
2746 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2747 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2752 laname
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2754 # Find the relevant object directory and library name.
2755 if test "X$installed" = Xyes
; then
2756 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2757 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2765 test "X$hardcode_automatic" = Xyes
&& avoidtemprpath
=yes
2767 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2770 # Remove this search path later
2771 notinst_path
="$notinst_path $abs_ladir"
2773 dir
="$ladir/$objdir"
2774 absdir
="$abs_ladir/$objdir"
2775 # Remove this search path later
2776 notinst_path
="$notinst_path $abs_ladir"
2778 fi # $installed = yes
2779 name
=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2781 # This library was specified with -dlpreopen.
2782 if test "$pass" = dlpreopen
; then
2783 if test -z "$libdir"; then
2784 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2787 # Prefer using a static library (so that no silly _DYNAMIC symbols
2788 # are required to link).
2789 if test -n "$old_library"; then
2790 newdlprefiles
="$newdlprefiles $dir/$old_library"
2791 # Otherwise, use the dlname, so that lt_dlopen finds it.
2792 elif test -n "$dlname"; then
2793 newdlprefiles
="$newdlprefiles $dir/$dlname"
2795 newdlprefiles
="$newdlprefiles $dir/$linklib"
2797 fi # $pass = dlpreopen
2799 if test -z "$libdir"; then
2800 # Link the convenience library
2801 if test "$linkmode" = lib
; then
2802 deplibs
="$dir/$old_library $deplibs"
2803 elif test "$linkmode,$pass" = "prog,link"; then
2804 compile_deplibs
="$dir/$old_library $compile_deplibs"
2805 finalize_deplibs
="$dir/$old_library $finalize_deplibs"
2807 deplibs
="$lib $deplibs" # used for prog,scan pass
2813 if test "$linkmode" = prog
&& test "$pass" != link
; then
2814 newlib_search_path
="$newlib_search_path $ladir"
2815 deplibs
="$lib $deplibs"
2818 if test "$link_all_deplibs" != no ||
test -z "$library_names" ||
2819 test "$build_libtool_libs" = no
; then
2824 for deplib
in $dependency_libs; do
2826 -L*) newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2828 # Need to link against all dependency_libs?
2829 if test "$linkalldeplibs" = yes; then
2830 deplibs
="$deplib $deplibs"
2832 # Need to hardcode shared library paths
2833 # or/and link against static libraries
2834 newdependency_libs
="$deplib $newdependency_libs"
2836 if test "X$duplicate_deps" = "Xyes" ; then
2837 case "$tmp_libs " in
2838 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2841 tmp_libs
="$tmp_libs $deplib"
2844 fi # $linkmode = prog...
2846 if test "$linkmode,$pass" = "prog,link"; then
2847 if test -n "$library_names" &&
2848 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
2849 # We need to hardcode the library path
2850 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2851 # Make sure the rpath contains only unique directories.
2852 case "$temp_rpath " in
2855 *) temp_rpath
="$temp_rpath $absdir" ;;
2859 # Hardcode the library path.
2860 # Skip directories that are in the system default run-time
2862 case " $sys_lib_dlsearch_path " in
2865 case "$compile_rpath " in
2867 *) compile_rpath
="$compile_rpath $absdir"
2871 case " $sys_lib_dlsearch_path " in
2874 case "$finalize_rpath " in
2876 *) finalize_rpath
="$finalize_rpath $libdir"
2880 fi # $linkmode,$pass = prog,link...
2882 if test "$alldeplibs" = yes &&
2883 { test "$deplibs_check_method" = pass_all ||
2884 { test "$build_libtool_libs" = yes &&
2885 test -n "$library_names"; }; }; then
2886 # We only need to search for static libraries
2891 link_static
=no
# Whether the deplib will be linked statically
2892 use_static_libs
=$prefer_static_libs
2893 if test "$use_static_libs" = built
&& test "$installed" = yes ; then
2896 if test -n "$library_names" &&
2897 { test "$use_static_libs" = no ||
test -z "$old_library"; }; then
2898 if test "$installed" = no
; then
2899 notinst_deplibs
="$notinst_deplibs $lib"
2902 # This is a shared library
2904 # Warn about portability, can't link against -module's on
2905 # some systems (darwin)
2906 if test "$shouldnotlink" = yes && test "$pass" = link
; then
2908 if test "$linkmode" = prog
; then
2909 $echo "*** Warning: Linking the executable $output against the loadable module"
2911 $echo "*** Warning: Linking the shared library $output against the loadable module"
2913 $echo "*** $linklib is not portable!"
2915 if test "$linkmode" = lib
&&
2916 test "$hardcode_into_libs" = yes; then
2917 # Hardcode the library path.
2918 # Skip directories that are in the system default run-time
2920 case " $sys_lib_dlsearch_path " in
2923 case "$compile_rpath " in
2925 *) compile_rpath
="$compile_rpath $absdir"
2929 case " $sys_lib_dlsearch_path " in
2932 case "$finalize_rpath " in
2934 *) finalize_rpath
="$finalize_rpath $libdir"
2940 if test -n "$old_archive_from_expsyms_cmds"; then
2941 # figure out the soname
2942 set dummy
$library_names
2945 libname
=`eval \\$echo \"$libname_spec\"`
2946 # use dlname if we got it. it's perfectly good, no?
2947 if test -n "$dlname"; then
2949 elif test -n "$soname_spec"; then
2953 major
=`expr $current - $age`
2957 eval soname
=\"$soname_spec\"
2962 # Make a new name for the extract_expsyms_cmds to use
2964 soname
=`$echo $soroot | ${SED} -e 's/^.*\///'`
2965 newlib
="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2967 # If the library has no export list, then create one now
2968 if test -f "$output_objdir/$soname-def"; then :
2970 $show "extracting exported symbol list from \`$soname'"
2971 save_ifs
="$IFS"; IFS
='~'
2972 cmds
=$extract_expsyms_cmds
2973 for cmd
in $cmds; do
2977 $run eval "$cmd" ||
exit $?
2983 if test -f "$output_objdir/$newlib"; then :; else
2984 $show "generating import library for \`$soname'"
2985 save_ifs
="$IFS"; IFS
='~'
2986 cmds
=$old_archive_from_expsyms_cmds
2987 for cmd
in $cmds; do
2991 $run eval "$cmd" ||
exit $?
2995 # make sure the library variables are pointing to the new library
2998 fi # test -n "$old_archive_from_expsyms_cmds"
3000 if test "$linkmode" = prog ||
test "$mode" != relink
; then
3005 case $hardcode_action in
3006 immediate | unsupported
)
3007 if test "$hardcode_direct" = no
; then
3010 *-*-sco3.2v5.0.
[024]*) add_dir
="-L$dir" ;;
3011 *-*-sysv4*uw2
*) add_dir
="-L$dir" ;;
3012 *-*-sysv5OpenUNIX* |
*-*-sysv5UnixWare7.
[01].
[10]* | \
3013 *-*-unixware7*) add_dir
="-L$dir" ;;
3015 # if the lib is a module then we can not link against
3016 # it, someone is ignoring the new warnings I added
3017 if /usr
/bin
/file -L $add 2> /dev
/null |
3018 $EGREP ": [^:]* bundle" >/dev
/null
; then
3019 $echo "** Warning, lib $linklib is a module, not a shared library"
3020 if test -z "$old_library" ; then
3022 $echo "** And there doesn't seem to be a static archive available"
3023 $echo "** The link will probably fail, sorry"
3025 add
="$dir/$old_library"
3029 elif test "$hardcode_minus_L" = no
; then
3031 *-*-sunos*) add_shlibpath
="$dir" ;;
3035 elif test "$hardcode_shlibpath_var" = no
; then
3036 add_shlibpath
="$dir"
3043 if test "$hardcode_direct" = yes; then
3045 elif test "$hardcode_minus_L" = yes; then
3047 # Try looking first in the location we're being installed to.
3048 if test -n "$inst_prefix_dir"; then
3051 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
3056 elif test "$hardcode_shlibpath_var" = yes; then
3057 add_shlibpath
="$dir"
3066 if test "$lib_linked" != yes; then
3067 $echo "$modename: configuration error: unsupported hardcode properties"
3071 if test -n "$add_shlibpath"; then
3072 case :$compile_shlibpath: in
3073 *":$add_shlibpath:"*) ;;
3074 *) compile_shlibpath
="$compile_shlibpath$add_shlibpath:" ;;
3077 if test "$linkmode" = prog
; then
3078 test -n "$add_dir" && compile_deplibs
="$add_dir $compile_deplibs"
3079 test -n "$add" && compile_deplibs
="$add $compile_deplibs"
3081 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
3082 test -n "$add" && deplibs
="$add $deplibs"
3083 if test "$hardcode_direct" != yes && \
3084 test "$hardcode_minus_L" != yes && \
3085 test "$hardcode_shlibpath_var" = yes; then
3086 case :$finalize_shlibpath: in
3088 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
3094 if test "$linkmode" = prog ||
test "$mode" = relink
; then
3098 # Finalize command for both is simple: just hardcode it.
3099 if test "$hardcode_direct" = yes; then
3100 add
="$libdir/$linklib"
3101 elif test "$hardcode_minus_L" = yes; then
3104 elif test "$hardcode_shlibpath_var" = yes; then
3105 case :$finalize_shlibpath: in
3107 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
3110 elif test "$hardcode_automatic" = yes; then
3111 if test -n "$inst_prefix_dir" &&
3112 test -f "$inst_prefix_dir$libdir/$linklib" ; then
3113 add
="$inst_prefix_dir$libdir/$linklib"
3115 add
="$libdir/$linklib"
3118 # We cannot seem to hardcode it, guess we'll fake it.
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"
3131 if test "$linkmode" = prog
; then
3132 test -n "$add_dir" && finalize_deplibs
="$add_dir $finalize_deplibs"
3133 test -n "$add" && finalize_deplibs
="$add $finalize_deplibs"
3135 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
3136 test -n "$add" && deplibs
="$add $deplibs"
3139 elif test "$linkmode" = prog
; then
3140 # Here we assume that one of hardcode_direct or hardcode_minus_L
3141 # is not unsupported. This is valid on all known static and
3143 if test "$hardcode_direct" != unsupported
; then
3144 test -n "$old_library" && linklib
="$old_library"
3145 compile_deplibs
="$dir/$linklib $compile_deplibs"
3146 finalize_deplibs
="$dir/$linklib $finalize_deplibs"
3148 compile_deplibs
="-l$name -L$dir $compile_deplibs"
3149 finalize_deplibs
="-l$name -L$dir $finalize_deplibs"
3151 elif test "$build_libtool_libs" = yes; then
3152 # Not a shared library
3153 if test "$deplibs_check_method" != pass_all
; then
3154 # We're trying link a shared library against a static one
3155 # but the system doesn't support it.
3157 # Just print a warning and add the library to dependency_libs so
3158 # that the program can be linked against the static library.
3160 $echo "*** Warning: This system can not link to static lib archive $lib."
3161 $echo "*** I have the capability to make that library automatically link in when"
3162 $echo "*** you link to this library. But I can only do this if you have a"
3163 $echo "*** shared version of the library, which you do not appear to have."
3164 if test "$module" = yes; then
3165 $echo "*** But as you try to build a module library, libtool will still create "
3166 $echo "*** a static module, that should work as long as the dlopening application"
3167 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
3168 if test -z "$global_symbol_pipe"; then
3170 $echo "*** However, this would only work if libtool was able to extract symbol"
3171 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3172 $echo "*** not find such a program. So, this module is probably useless."
3173 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3175 if test "$build_old_libs" = no
; then
3176 build_libtool_libs
=module
3179 build_libtool_libs
=no
3183 deplibs
="$dir/$old_library $deplibs"
3186 fi # link shared/static library?
3188 if test "$linkmode" = lib
; then
3189 if test -n "$dependency_libs" &&
3190 { test "$hardcode_into_libs" != yes ||
3191 test "$build_old_libs" = yes ||
3192 test "$link_static" = yes; }; then
3193 # Extract -R from dependency_libs
3195 for libdir
in $dependency_libs; do
3197 -R*) temp_xrpath
=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
3199 *" $temp_xrpath "*) ;;
3200 *) xrpath
="$xrpath $temp_xrpath";;
3202 *) temp_deplibs
="$temp_deplibs $libdir";;
3205 dependency_libs
="$temp_deplibs"
3208 newlib_search_path
="$newlib_search_path $absdir"
3209 # Link against this library
3210 test "$link_static" = no
&& newdependency_libs
="$abs_ladir/$laname $newdependency_libs"
3211 # ... and its dependency_libs
3213 for deplib
in $dependency_libs; do
3214 newdependency_libs
="$deplib $newdependency_libs"
3215 if test "X$duplicate_deps" = "Xyes" ; then
3216 case "$tmp_libs " in
3217 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
3220 tmp_libs
="$tmp_libs $deplib"
3223 if test "$link_all_deplibs" != no
; then
3224 # Add the search paths of all dependency libraries
3225 for deplib
in $dependency_libs; do
3227 -L*) path
="$deplib" ;;
3229 dir
=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
3230 test "X$dir" = "X$deplib" && dir
="."
3231 # We need an absolute path.
3233 [\\/]* |
[A-Za-z
]:[\\/]*) absdir
="$dir" ;;
3235 absdir
=`cd "$dir" && pwd`
3236 if test -z "$absdir"; then
3237 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
3242 if grep "^installed=no" $deplib > /dev
/null
; then
3243 path
="$absdir/$objdir"
3245 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3246 if test -z "$libdir"; then
3247 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3250 if test "$absdir" != "$libdir"; then
3251 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
3258 # we do not want to link against static libs,
3259 # but need to link against shared
3260 eval deplibrary_names
=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
3261 if test -n "$deplibrary_names" ; then
3262 for tmp
in $deplibrary_names ; do
3265 if test -f "$path/$depdepl" ; then
3266 depdepl
="$path/$depdepl"
3268 # do not add paths which are already there
3269 case " $newlib_search_path " in
3271 *) newlib_search_path
="$newlib_search_path $path";;
3284 # Again, we only want to link against shared libraries
3285 eval tmp_libs
=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
3286 for tmp
in $newlib_search_path ; do
3287 if test -f "$tmp/lib$tmp_libs.dylib" ; then
3288 eval depdepl
="$tmp/lib$tmp_libs.dylib"
3299 case " $deplibs " in
3301 *) deplibs
="$path $deplibs" ;;
3303 case " $deplibs " in
3305 *) deplibs
="$depdepl $deplibs" ;;
3308 fi # link_all_deplibs != no
3310 done # for deplib in $libs
3311 dependency_libs
="$newdependency_libs"
3312 if test "$pass" = dlpreopen
; then
3313 # Link the dlpreopened libraries before other libraries
3314 for deplib
in $save_deplibs; do
3315 deplibs
="$deplib $deplibs"
3318 if test "$pass" != dlopen
; then
3319 if test "$pass" != conv
; then
3320 # Make sure lib_search_path contains only unique directories.
3322 for dir
in $newlib_search_path; do
3323 case "$lib_search_path " in
3325 *) lib_search_path
="$lib_search_path $dir" ;;
3331 if test "$linkmode,$pass" != "prog,link"; then
3334 vars
="compile_deplibs finalize_deplibs"
3336 for var
in $vars dependency_libs
; do
3337 # Add libraries to $var in reverse order
3338 eval tmp_libs
=\"\$
$var\"
3340 for deplib
in $tmp_libs; do
3341 # FIXME: Pedantically, this is the right thing to do, so
3342 # that some nasty dependency loop isn't accidentally
3344 #new_libs="$deplib $new_libs"
3345 # Pragmatically, this seems to cause very few problems in
3348 -L*) new_libs
="$deplib $new_libs" ;;
3351 # And here is the reason: when a library appears more
3352 # than once as an explicit dependence of a library, or
3353 # is implicitly linked in more than once by the
3354 # compiler, it is considered special, and multiple
3355 # occurrences thereof are not removed. Compare this
3356 # with having the same library being listed as a
3357 # dependency of multiple other libraries: in this case,
3358 # we know (pedantically, we assume) the library does not
3359 # need to be listed more than once, so we keep only the
3360 # last copy. This is not always right, but it is rare
3361 # enough that we require users that really mean to play
3362 # such unportable linking tricks to link the library
3363 # using -Wl,-lname, so that libtool does not consider it
3364 # for duplicate removal.
3365 case " $specialdeplibs " in
3366 *" $deplib "*) new_libs
="$deplib $new_libs" ;;
3368 case " $new_libs " in
3370 *) new_libs
="$deplib $new_libs" ;;
3378 for deplib
in $new_libs; do
3381 case " $tmp_libs " in
3383 *) tmp_libs
="$tmp_libs $deplib" ;;
3386 *) tmp_libs
="$tmp_libs $deplib" ;;
3389 eval $var=\"$tmp_libs\"
3392 # Last step: remove runtime libs from dependency_libs
3393 # (they stay in deplibs)
3395 for i
in $dependency_libs ; do
3396 case " $predeps $postdeps $compiler_lib_search_path " in
3401 if test -n "$i" ; then
3402 tmp_libs
="$tmp_libs $i"
3405 dependency_libs
=$tmp_libs
3407 if test "$linkmode" = prog
; then
3408 dlfiles
="$newdlfiles"
3409 dlprefiles
="$newdlprefiles"
3414 if test -n "$deplibs"; then
3415 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
3418 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3419 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3422 if test -n "$rpath"; then
3423 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3426 if test -n "$xrpath"; then
3427 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3430 if test -n "$vinfo"; then
3431 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3434 if test -n "$release"; then
3435 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3438 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
3439 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3442 # Now set the variables for building old libraries.
3443 build_libtool_libs
=no
3445 objs
="$objs$old_deplibs"
3449 # Make sure we only generate libraries of the form `libNAME.la'.
3452 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3453 eval shared_ext
=\"$shrext_cmds\"
3454 eval libname
=\"$libname_spec\"
3457 if test "$module" = no
; then
3458 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3462 if test "$need_lib_prefix" != no
; then
3463 # Add the "lib" prefix for modules if required
3464 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3465 eval shared_ext
=\"$shrext_cmds\"
3466 eval libname
=\"$libname_spec\"
3468 libname
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3473 if test -n "$objs"; then
3474 if test "$deplibs_check_method" != pass_all
; then
3475 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3479 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3480 $echo "*** objects $objs is not portable!"
3481 libobjs
="$libobjs $objs"
3485 if test "$dlself" != no
; then
3486 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3490 if test "$#" -gt 2; then
3491 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3496 if test -z "$rpath"; then
3497 if test "$build_libtool_libs" = yes; then
3498 # Building a libtool convenience library.
3499 # Some compilers have problems with a `.al' extension so
3500 # convenience libraries should have the same extension an
3501 # archive normally would.
3502 oldlibs
="$output_objdir/$libname.$libext $oldlibs"
3503 build_libtool_libs
=convenience
3507 if test -n "$vinfo"; then
3508 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3511 if test -n "$release"; then
3512 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3516 # Parse the version information argument.
3517 save_ifs
="$IFS"; IFS
=':'
3518 set dummy
$vinfo 0 0 0
3521 if test -n "$8"; then
3522 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3527 # convert absolute version numbers to libtool ages
3528 # this retains compatibility with .la files and attempts
3529 # to make the code below a bit more comprehensible
3531 case $vinfo_number in
3535 number_revision
="$4"
3537 # There are really only two kinds -- those that
3538 # use the current revision as the major version
3539 # and those that subtract age and use age as
3540 # a minor version. But, then there is irix
3541 # which has an extra 1 added just for fun
3543 case $version_type in
3544 darwin|linux|osf|windows
)
3545 current
=`expr $number_major + $number_minor`
3547 revision
="$number_revision"
3549 freebsd-aout|freebsd-elf|sunos
)
3550 current
="$number_major"
3551 revision
="$number_minor"
3555 current
=`expr $number_major + $number_minor - 1`
3557 revision
="$number_minor"
3560 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3561 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3573 # Check that each of the things are valid numbers.
3575 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]) ;;
3577 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3578 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3584 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]) ;;
3586 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3587 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3593 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]) ;;
3595 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3596 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3601 if test "$age" -gt "$current"; then
3602 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3603 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3607 # Calculate the version variables.
3611 case $version_type in
3615 # Like Linux, but with the current version available in
3616 # verstring for coding it into the library header
3617 major
=.
`expr $current - $age`
3618 versuffix
="$major.$age.$revision"
3619 # Darwin ld doesn't like 0 for these options...
3620 minor_current
=`expr $current + 1`
3621 verstring
="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3626 versuffix
=".$current.$revision";
3631 versuffix
=".$current";
3635 major
=`expr $current - $age + 1`
3637 case $version_type in
3638 nonstopux
) verstring_prefix
=nonstopux
;;
3639 *) verstring_prefix
=sgi
;;
3641 verstring
="$verstring_prefix$major.$revision"
3643 # Add in all the interfaces that we are compatible with.
3645 while test "$loop" -ne 0; do
3646 iface
=`expr $revision - $loop`
3647 loop
=`expr $loop - 1`
3648 verstring
="$verstring_prefix$major.$iface:$verstring"
3651 # Before this point, $major must not contain `.'.
3653 versuffix
="$major.$revision"
3657 major
=.
`expr $current - $age`
3658 versuffix
="$major.$age.$revision"
3662 major
=.
`expr $current - $age`
3663 versuffix
=".$current.$age.$revision"
3664 verstring
="$current.$age.$revision"
3666 # Add in all the interfaces that we are compatible with.
3668 while test "$loop" -ne 0; do
3669 iface
=`expr $current - $loop`
3670 loop
=`expr $loop - 1`
3671 verstring
="$verstring:${iface}.0"
3674 # Make executables depend on our current version.
3675 verstring
="$verstring:${current}.0"
3680 versuffix
=".$current.$revision"
3684 # Use '-' rather than '.', since we only want one
3685 # extension on DOS 8.3 filesystems.
3686 major
=`expr $current - $age`
3691 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3692 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3697 # Clear the version info if we defaulted, and they specified a release.
3698 if test -z "$vinfo" && test -n "$release"; then
3700 case $version_type in
3702 # we can't check for "0.0" in archive_cmds due to quoting
3703 # problems, so we reset it completely
3710 if test "$need_version" = no
; then
3717 # Remove version info from name if versioning should be avoided
3718 if test "$avoid_version" = yes && test "$need_version" = no
; then
3724 # Check to see if the archive will have undefined symbols.
3725 if test "$allow_undefined" = yes; then
3726 if test "$allow_undefined_flag" = unsupported
; then
3727 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3728 build_libtool_libs
=no
3732 # Don't allow undefined symbols.
3733 allow_undefined_flag
="$no_undefined_flag"
3737 if test "$mode" != relink
; then
3738 # Remove our outputs, but don't remove object files since they
3739 # may have been created when compiling PIC objects.
3741 tempremovelist
=`$echo "$output_objdir/*"`
3742 for p
in $tempremovelist; do
3746 $output_objdir/$outputname |
$output_objdir/$libname.
* |
$output_objdir/${libname}${release}.
*)
3747 if test "X$precious_files_regex" != "X"; then
3748 if echo $p |
$EGREP -e "$precious_files_regex" >/dev
/null
2>&1
3753 removelist
="$removelist $p"
3758 if test -n "$removelist"; then
3759 $show "${rm}r $removelist"
3760 $run ${rm}r
$removelist
3764 # Now set the variables for building old libraries.
3765 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience
; then
3766 oldlibs
="$oldlibs $output_objdir/$libname.$libext"
3768 # Transform .lo files to .o files.
3769 oldobjs
="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3772 # Eliminate all temporary directories.
3773 for path
in $notinst_path; do
3774 lib_search_path
=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
3775 deplibs
=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
3776 dependency_libs
=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
3779 if test -n "$xrpath"; then
3780 # If the user specified any rpath flags, then add them.
3782 for libdir
in $xrpath; do
3783 temp_xrpath
="$temp_xrpath -R$libdir"
3784 case "$finalize_rpath " in
3786 *) finalize_rpath
="$finalize_rpath $libdir" ;;
3789 if test "$hardcode_into_libs" != yes ||
test "$build_old_libs" = yes; then
3790 dependency_libs
="$temp_xrpath $dependency_libs"
3794 # Make sure dlfiles contains only unique files that won't be dlpreopened
3795 old_dlfiles
="$dlfiles"
3797 for lib
in $old_dlfiles; do
3798 case " $dlprefiles $dlfiles " in
3800 *) dlfiles
="$dlfiles $lib" ;;
3804 # Make sure dlprefiles contains only unique files
3805 old_dlprefiles
="$dlprefiles"
3807 for lib
in $old_dlprefiles; do
3808 case "$dlprefiles " in
3810 *) dlprefiles
="$dlprefiles $lib" ;;
3814 if test "$build_libtool_libs" = yes; then
3815 if test -n "$rpath"; then
3817 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2* |
*-*-beos*)
3818 # these systems don't actually have a c library (as such)!
3820 *-*-rhapsody* |
*-*-darwin1.
[012])
3821 # Rhapsody C library is in the System framework
3822 deplibs
="$deplibs -framework System"
3825 # Don't link with libc until the a.out ld.so is fixed.
3827 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
3828 # Do not include libc due to us having libc/libc_r.
3830 *-*-sco3.2v5
* |
*-*-sco5v6*)
3831 # Causes problems with __ctype
3833 *-*-sysv4.2uw2
* |
*-*-sysv5* |
*-*-unixware* |
*-*-OpenUNIX*)
3834 # Compiler inserts libc in the correct place for threads to work
3837 # Add libc to deplibs on all other systems if necessary.
3838 if test "$build_libtool_need_lc" = "yes"; then
3839 deplibs
="$deplibs -lc"
3845 # Transform deplibs into only deplibs that can be linked in shared.
3847 libname_save
=$libname
3848 release_save
=$release
3849 versuffix_save
=$versuffix
3851 # I'm not sure if I'm treating the release correctly. I think
3852 # release should show up in the -l (ie -lgmp5) so we don't want to
3853 # add it in twice. Is that correct?
3859 case $deplibs_check_method in
3861 # Don't check for shared/static. Everything works.
3862 # This might be a little naive. We might want to check
3863 # whether the library exists or not. But this is on
3864 # osf3 & osf4 and I'm not really sure... Just
3865 # implementing what was already the behavior.
3869 # This code stresses the "libraries are programs" paradigm to its
3870 # limits. Maybe even breaks it. We compile a program, linking it
3871 # against the deplibs as a proxy for the library. Then we can check
3872 # whether they linked in statically or dynamically with ldd.
3874 cat > conftest.c
<<EOF
3875 int main() { return 0; }
3878 $LTCC $LTCFLAGS -o conftest conftest.c
$deplibs
3879 if test "$?" -eq 0 ; then
3880 ldd_output
=`ldd conftest`
3881 for i
in $deplibs; do
3882 name
=`expr $i : '-l\(.*\)'`
3883 # If $name is empty we are operating on a -L argument.
3884 if test "$name" != "" && test "$name" -ne "0"; then
3885 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3886 case " $predeps $postdeps " in
3888 newdeplibs
="$newdeplibs $i"
3893 if test -n "$i" ; then
3894 libname
=`eval \\$echo \"$libname_spec\"`
3895 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
3896 set dummy
$deplib_matches
3898 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3899 newdeplibs
="$newdeplibs $i"
3903 $echo "*** Warning: dynamic linker does not accept needed library $i."
3904 $echo "*** I have the capability to make that library automatically link in when"
3905 $echo "*** you link to this library. But I can only do this if you have a"
3906 $echo "*** shared version of the library, which I believe you do not have"
3907 $echo "*** because a test_compile did reveal that the linker did not use it for"
3908 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3912 newdeplibs
="$newdeplibs $i"
3916 # Error occurred in the first compile. Let's try to salvage
3917 # the situation: Compile a separate program for each library.
3918 for i
in $deplibs; do
3919 name
=`expr $i : '-l\(.*\)'`
3920 # If $name is empty we are operating on a -L argument.
3921 if test "$name" != "" && test "$name" != "0"; then
3923 $LTCC $LTCFLAGS -o conftest conftest.c
$i
3925 if test "$?" -eq 0 ; then
3926 ldd_output
=`ldd conftest`
3927 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3928 case " $predeps $postdeps " in
3930 newdeplibs
="$newdeplibs $i"
3935 if test -n "$i" ; then
3936 libname
=`eval \\$echo \"$libname_spec\"`
3937 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
3938 set dummy
$deplib_matches
3940 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3941 newdeplibs
="$newdeplibs $i"
3945 $echo "*** Warning: dynamic linker does not accept needed library $i."
3946 $echo "*** I have the capability to make that library automatically link in when"
3947 $echo "*** you link to this library. But I can only do this if you have a"
3948 $echo "*** shared version of the library, which you do not appear to have"
3949 $echo "*** because a test_compile did reveal that the linker did not use this one"
3950 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3956 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3957 $echo "*** make it link in! You will probably need to install it or some"
3958 $echo "*** library that it depends on before this library will be fully"
3959 $echo "*** functional. Installing it before continuing would be even better."
3962 newdeplibs
="$newdeplibs $i"
3968 set dummy
$deplibs_check_method
3969 file_magic_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3970 for a_deplib
in $deplibs; do
3971 name
=`expr $a_deplib : '-l\(.*\)'`
3972 # If $name is empty we are operating on a -L argument.
3973 if test "$name" != "" && test "$name" != "0"; then
3974 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3975 case " $predeps $postdeps " in
3977 newdeplibs
="$newdeplibs $a_deplib"
3982 if test -n "$a_deplib" ; then
3983 libname
=`eval \\$echo \"$libname_spec\"`
3984 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3985 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
3986 for potent_lib
in $potential_libs; do
3987 # Follow soft links.
3988 if ls -lLd "$potent_lib" 2>/dev
/null \
3989 |
grep " -> " >/dev
/null
; then
3992 # The statement above tries to avoid entering an
3993 # endless loop below, in case of cyclic links.
3994 # We might still enter an endless loop, since a link
3995 # loop can be closed while we follow links,
3997 potlib
="$potent_lib"
3998 while test -h "$potlib" 2>/dev
/null
; do
3999 potliblink
=`ls -ld $potlib | ${SED} 's/.* -> //'`
4001 [\\/]* |
[A-Za-z
]:[\\/]*) potlib
="$potliblink";;
4002 *) potlib
=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
4005 if eval $file_magic_cmd \"\
$potlib\" 2>/dev
/null \
4007 |
$EGREP "$file_magic_regex" > /dev
/null
; then
4008 newdeplibs
="$newdeplibs $a_deplib"
4015 if test -n "$a_deplib" ; then
4018 $echo "*** Warning: linker path does not have real file for library $a_deplib."
4019 $echo "*** I have the capability to make that library automatically link in when"
4020 $echo "*** you link to this library. But I can only do this if you have a"
4021 $echo "*** shared version of the library, which you do not appear to have"
4022 $echo "*** because I did check the linker path looking for a file starting"
4023 if test -z "$potlib" ; then
4024 $echo "*** with $libname but no candidates were found. (...for file magic test)"
4026 $echo "*** with $libname and none of the candidates passed a file format test"
4027 $echo "*** using a file magic. Last file checked: $potlib"
4031 # Add a -L argument.
4032 newdeplibs
="$newdeplibs $a_deplib"
4034 done # Gone through all deplibs.
4037 set dummy
$deplibs_check_method
4038 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
4039 for a_deplib
in $deplibs; do
4040 name
=`expr $a_deplib : '-l\(.*\)'`
4041 # If $name is empty we are operating on a -L argument.
4042 if test -n "$name" && test "$name" != "0"; then
4043 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4044 case " $predeps $postdeps " in
4046 newdeplibs
="$newdeplibs $a_deplib"
4051 if test -n "$a_deplib" ; then
4052 libname
=`eval \\$echo \"$libname_spec\"`
4053 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
4054 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
4055 for potent_lib
in $potential_libs; do
4056 potlib
="$potent_lib" # see symlink-check above in file_magic test
4057 if eval $echo \"$potent_lib\" 2>/dev
/null \
4059 |
$EGREP "$match_pattern_regex" > /dev
/null
; then
4060 newdeplibs
="$newdeplibs $a_deplib"
4067 if test -n "$a_deplib" ; then
4070 $echo "*** Warning: linker path does not have real file for library $a_deplib."
4071 $echo "*** I have the capability to make that library automatically link in when"
4072 $echo "*** you link to this library. But I can only do this if you have a"
4073 $echo "*** shared version of the library, which you do not appear to have"
4074 $echo "*** because I did check the linker path looking for a file starting"
4075 if test -z "$potlib" ; then
4076 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
4078 $echo "*** with $libname and none of the candidates passed a file format test"
4079 $echo "*** using a regex pattern. Last file checked: $potlib"
4083 # Add a -L argument.
4084 newdeplibs
="$newdeplibs $a_deplib"
4086 done # Gone through all deplibs.
4090 tmp_deplibs
=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
4091 -e 's/ -[LR][^ ]*//g'`
4092 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4093 for i
in $predeps $postdeps ; do
4094 # can't use Xsed below, because $i might contain '/'
4095 tmp_deplibs
=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
4098 if $echo "X $tmp_deplibs" |
$Xsed -e 's/[ ]//g' \
4099 |
grep .
>/dev
/null
; then
4101 if test "X$deplibs_check_method" = "Xnone"; then
4102 $echo "*** Warning: inter-library dependencies are not supported in this platform."
4104 $echo "*** Warning: inter-library dependencies are not known to be supported."
4106 $echo "*** All declared inter-library dependencies are being dropped."
4111 versuffix
=$versuffix_save
4113 release
=$release_save
4114 libname
=$libname_save
4118 *-*-rhapsody* |
*-*-darwin1.
[012])
4119 # On Rhapsody replace the C library is the System framework
4120 newdeplibs
=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
4124 if test "$droppeddeps" = yes; then
4125 if test "$module" = yes; then
4127 $echo "*** Warning: libtool could not satisfy all declared inter-library"
4128 $echo "*** dependencies of module $libname. Therefore, libtool will create"
4129 $echo "*** a static module, that should work as long as the dlopening"
4130 $echo "*** application is linked with the -dlopen flag."
4131 if test -z "$global_symbol_pipe"; then
4133 $echo "*** However, this would only work if libtool was able to extract symbol"
4134 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
4135 $echo "*** not find such a program. So, this module is probably useless."
4136 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
4138 if test "$build_old_libs" = no
; then
4139 oldlibs
="$output_objdir/$libname.$libext"
4140 build_libtool_libs
=module
4143 build_libtool_libs
=no
4146 $echo "*** The inter-library dependencies that have been dropped here will be"
4147 $echo "*** automatically added whenever a program is linked with this library"
4148 $echo "*** or is declared to -dlopen it."
4150 if test "$allow_undefined" = no
; then
4152 $echo "*** Since this library must not contain undefined symbols,"
4153 $echo "*** because either the platform does not support them or"
4154 $echo "*** it was explicitly requested with -no-undefined,"
4155 $echo "*** libtool will only create a static version of it."
4156 if test "$build_old_libs" = no
; then
4157 oldlibs
="$output_objdir/$libname.$libext"
4158 build_libtool_libs
=module
4161 build_libtool_libs
=no
4166 # Done checking deplibs!
4171 # move library search paths that coincide with paths to not yet
4172 # installed libraries to the beginning of the library search list
4174 for path
in $notinst_path; do
4175 case " $new_libs " in
4176 *" -L$path/$objdir "*) ;;
4178 case " $deplibs " in
4179 *" -L$path/$objdir "*)
4180 new_libs
="$new_libs -L$path/$objdir" ;;
4185 for deplib
in $deplibs; do
4188 case " $new_libs " in
4190 *) new_libs
="$new_libs $deplib" ;;
4193 *) new_libs
="$new_libs $deplib" ;;
4199 # All the library-specific variables (install_libdir is set above).
4204 # Test again, we may have decided not to build it any more
4205 if test "$build_libtool_libs" = yes; then
4206 if test "$hardcode_into_libs" = yes; then
4207 # Hardcode the library paths
4210 rpath
="$finalize_rpath"
4211 test "$mode" != relink
&& rpath
="$compile_rpath$rpath"
4212 for libdir
in $rpath; do
4213 if test -n "$hardcode_libdir_flag_spec"; then
4214 if test -n "$hardcode_libdir_separator"; then
4215 if test -z "$hardcode_libdirs"; then
4216 hardcode_libdirs
="$libdir"
4218 # Just accumulate the unique libdirs.
4219 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4220 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4223 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4228 eval flag
=\"$hardcode_libdir_flag_spec\"
4229 dep_rpath
="$dep_rpath $flag"
4231 elif test -n "$runpath_var"; then
4232 case "$perm_rpath " in
4234 *) perm_rpath
="$perm_rpath $libdir" ;;
4238 # Substitute the hardcoded libdirs into the rpath.
4239 if test -n "$hardcode_libdir_separator" &&
4240 test -n "$hardcode_libdirs"; then
4241 libdir
="$hardcode_libdirs"
4242 if test -n "$hardcode_libdir_flag_spec_ld"; then
4243 eval dep_rpath
=\"$hardcode_libdir_flag_spec_ld\"
4245 eval dep_rpath
=\"$hardcode_libdir_flag_spec\"
4248 if test -n "$runpath_var" && test -n "$perm_rpath"; then
4249 # We should set the runpath_var.
4251 for dir
in $perm_rpath; do
4254 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
4256 test -n "$dep_rpath" && deplibs
="$dep_rpath $deplibs"
4259 shlibpath
="$finalize_shlibpath"
4260 test "$mode" != relink
&& shlibpath
="$compile_shlibpath$shlibpath"
4261 if test -n "$shlibpath"; then
4262 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
4265 # Get the real and link names of the library.
4266 eval shared_ext
=\"$shrext_cmds\"
4267 eval library_names
=\"$library_names_spec\"
4268 set dummy
$library_names
4272 if test -n "$soname_spec"; then
4273 eval soname
=\"$soname_spec\"
4277 if test -z "$dlname"; then
4281 lib
="$output_objdir/$realname"
4285 linknames
="$linknames $link"
4288 # Use standard objects if they are pic
4289 test -z "$pic_flag" && libobjs
=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4291 # Prepare the list of exported symbols
4292 if test -z "$export_symbols"; then
4293 if test "$always_export_symbols" = yes ||
test -n "$export_symbols_regex"; then
4294 $show "generating symbol list for \`$libname.la'"
4295 export_symbols
="$output_objdir/$libname.exp"
4296 $run $rm $export_symbols
4297 cmds
=$export_symbols_cmds
4298 save_ifs
="$IFS"; IFS
='~'
4299 for cmd
in $cmds; do
4302 if len
=`expr "X$cmd" : ".*"` &&
4303 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
4305 $run eval "$cmd" ||
exit $?
4306 skipped_export
=false
4308 # The command line is too long to execute in one step.
4309 $show "using reloadable object file for export list..."
4311 # Break out early, otherwise skipped_export may be
4312 # set to false by a later but shorter cmd.
4317 if test -n "$export_symbols_regex"; then
4318 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
4319 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
4320 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
4321 $run eval '$mv "${export_symbols}T" "$export_symbols"'
4326 if test -n "$export_symbols" && test -n "$include_expsyms"; then
4327 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
4331 for test_deplib
in $deplibs; do
4332 case " $convenience " in
4333 *" $test_deplib "*) ;;
4335 tmp_deplibs
="$tmp_deplibs $test_deplib"
4339 deplibs
="$tmp_deplibs"
4341 if test -n "$convenience"; then
4342 if test -n "$whole_archive_flag_spec"; then
4343 save_libobjs
=$libobjs
4344 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
4346 gentop
="$output_objdir/${outputname}x"
4347 generated
="$generated $gentop"
4349 func_extract_archives
$gentop $convenience
4350 libobjs
="$libobjs $func_extract_archives_result"
4354 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
4355 eval flag
=\"$thread_safe_flag_spec\"
4356 linker_flags
="$linker_flags $flag"
4359 # Make a backup of the uninstalled library when relinking
4360 if test "$mode" = relink
; then
4361 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' ||
exit $?
4364 # Do each of the archive commands.
4365 if test "$module" = yes && test -n "$module_cmds" ; then
4366 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4367 eval test_cmds
=\"$module_expsym_cmds\"
4368 cmds
=$module_expsym_cmds
4370 eval test_cmds
=\"$module_cmds\"
4374 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4375 eval test_cmds
=\"$archive_expsym_cmds\"
4376 cmds
=$archive_expsym_cmds
4378 eval test_cmds
=\"$archive_cmds\"
4383 if test "X$skipped_export" != "X:" &&
4384 len
=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4385 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
4388 # The command line is too long to link in one step, link piecewise.
4389 $echo "creating reloadable object files..."
4391 # Save the value of $output and $libobjs because we want to
4392 # use them later. If we have whole_archive_flag_spec, we
4393 # want to use save_libobjs as it was before
4394 # whole_archive_flag_spec was expanded, because we can't
4395 # assume the linker understands whole_archive_flag_spec.
4396 # This may have to be revisited, in case too many
4397 # convenience libraries get linked in and end up exceeding
4399 if test -z "$convenience" ||
test -z "$whole_archive_flag_spec"; then
4400 save_libobjs
=$libobjs
4403 output_la
=`$echo "X$output" | $Xsed -e "$basename"`
4405 # Clear the reloadable object creation command queue and
4406 # initialize k to one.
4413 output
=$output_objdir/$output_la-${k}.
$objext
4414 # Loop over the list of objects to be linked.
4415 for obj
in $save_libobjs
4417 eval test_cmds
=\"$reload_cmds $objlist $last_robj\"
4418 if test "X$objlist" = X ||
4419 { len
=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4420 test "$len" -le "$max_cmd_len"; }; then
4421 objlist
="$objlist $obj"
4423 # The command $test_cmds is almost too long, add a
4424 # command to the queue.
4425 if test "$k" -eq 1 ; then
4426 # The first file doesn't have a previous command to add.
4427 eval concat_cmds
=\"$reload_cmds $objlist $last_robj\"
4429 # All subsequent reloadable object files will link in
4430 # the last one created.
4431 eval concat_cmds
=\"\
$concat_cmds~
$reload_cmds $objlist $last_robj\"
4433 last_robj
=$output_objdir/$output_la-${k}.
$objext
4435 output
=$output_objdir/$output_la-${k}.
$objext
4440 # Handle the remaining objects by creating one last
4441 # reloadable object file. All subsequent reloadable object
4442 # files will link in the last one created.
4443 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
4444 eval concat_cmds
=\"\
${concat_cmds}$reload_cmds $objlist $last_robj\"
4446 if ${skipped_export-false}; then
4447 $show "generating symbol list for \`$libname.la'"
4448 export_symbols
="$output_objdir/$libname.exp"
4449 $run $rm $export_symbols
4451 # Append the command to create the export file.
4452 eval concat_cmds
=\"\
$concat_cmds~
$export_symbols_cmds\"
4455 # Set up a command to remove the reloadable object files
4456 # after they are used.
4458 while test "$i" -lt "$k"
4461 delfiles
="$delfiles $output_objdir/$output_la-${i}.$objext"
4464 $echo "creating a temporary reloadable object file: $output"
4466 # Loop through the commands generated above and execute them.
4467 save_ifs
="$IFS"; IFS
='~'
4468 for cmd
in $concat_cmds; do
4471 $run eval "$cmd" ||
exit $?
4476 # Restore the value of output.
4479 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4480 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
4482 # Expand the library linking commands again to reset the
4483 # value of $libobjs for piecewise linking.
4485 # Do each of the archive commands.
4486 if test "$module" = yes && test -n "$module_cmds" ; then
4487 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4488 cmds
=$module_expsym_cmds
4493 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4494 cmds
=$archive_expsym_cmds
4500 # Append the command to remove the reloadable object files
4501 # to the just-reset $cmds.
4502 eval cmds
=\"\
$cmds~\
$rm $delfiles\"
4504 save_ifs
="$IFS"; IFS
='~'
4505 for cmd
in $cmds; do
4509 $run eval "$cmd" ||
{
4512 # Restore the uninstalled library and exit
4513 if test "$mode" = relink
; then
4514 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
4522 # Restore the uninstalled library and exit
4523 if test "$mode" = relink
; then
4524 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' ||
exit $?
4526 if test -n "$convenience"; then
4527 if test -z "$whole_archive_flag_spec"; then
4528 $show "${rm}r $gentop"
4529 $run ${rm}r
"$gentop"
4536 # Create links to the real library.
4537 for linkname
in $linknames; do
4538 if test "$realname" != "$linkname"; then
4539 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4540 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' ||
exit $?
4544 # If -module or -export-dynamic was specified, set the dlname.
4545 if test "$module" = yes ||
test "$export_dynamic" = yes; then
4546 # On all known operating systems, these are identical.
4553 if test -n "$deplibs"; then
4554 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4557 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
4558 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4561 if test -n "$rpath"; then
4562 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4565 if test -n "$xrpath"; then
4566 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4569 if test -n "$vinfo"; then
4570 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4573 if test -n "$release"; then
4574 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4579 if test -n "$objs$old_deplibs"; then
4580 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4584 obj
=`$echo "X$output" | $Xsed -e "$lo2o"`
4592 # Delete the old objects.
4593 $run $rm $obj $libobj
4595 # Objects from convenience libraries. This assumes
4596 # single-version convenience libraries. Whenever we create
4597 # different ones for PIC/non-PIC, this we'll have to duplicate
4601 # reload_cmds runs $LD directly, so let us get rid of
4602 # -Wl from whole_archive_flag_spec
4605 if test -n "$convenience"; then
4606 if test -n "$whole_archive_flag_spec"; then
4607 eval reload_conv_objs
=\"\
$reload_objs $whole_archive_flag_spec\"
4609 gentop
="$output_objdir/${obj}x"
4610 generated
="$generated $gentop"
4612 func_extract_archives
$gentop $convenience
4613 reload_conv_objs
="$reload_objs $func_extract_archives_result"
4617 # Create the old-style object.
4618 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
4622 save_ifs
="$IFS"; IFS
='~'
4623 for cmd
in $cmds; do
4627 $run eval "$cmd" ||
exit $?
4631 # Exit if we aren't doing a library object file.
4632 if test -z "$libobj"; then
4633 if test -n "$gentop"; then
4634 $show "${rm}r $gentop"
4641 if test "$build_libtool_libs" != yes; then
4642 if test -n "$gentop"; then
4643 $show "${rm}r $gentop"
4647 # Create an invalid libtool object if no PIC, so that we don't
4648 # accidentally link it into a program.
4649 # $show "echo timestamp > $libobj"
4650 # $run eval "echo timestamp > $libobj" || exit $?
4654 if test -n "$pic_flag" ||
test "$pic_mode" != default
; then
4655 # Only do commands if we really have different PIC objects.
4656 reload_objs
="$libobjs $reload_conv_objs"
4659 save_ifs
="$IFS"; IFS
='~'
4660 for cmd
in $cmds; do
4664 $run eval "$cmd" ||
exit $?
4669 if test -n "$gentop"; then
4670 $show "${rm}r $gentop"
4679 *cygwin
*) output
=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4681 if test -n "$vinfo"; then
4682 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4685 if test -n "$release"; then
4686 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4689 if test "$preload" = yes; then
4690 if test "$dlopen_support" = unknown
&& test "$dlopen_self" = unknown
&&
4691 test "$dlopen_self_static" = unknown
; then
4692 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4697 *-*-rhapsody* |
*-*-darwin1.
[012])
4698 # On Rhapsody replace the C library is the System framework
4699 compile_deplibs
=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4700 finalize_deplibs
=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4706 # Don't allow lazy linking, it breaks C++ global constructors
4707 if test "$tagname" = CXX
; then
4708 compile_command
="$compile_command ${wl}-bind_at_load"
4709 finalize_command
="$finalize_command ${wl}-bind_at_load"
4715 # move library search paths that coincide with paths to not yet
4716 # installed libraries to the beginning of the library search list
4718 for path
in $notinst_path; do
4719 case " $new_libs " in
4720 *" -L$path/$objdir "*) ;;
4722 case " $compile_deplibs " in
4723 *" -L$path/$objdir "*)
4724 new_libs
="$new_libs -L$path/$objdir" ;;
4729 for deplib
in $compile_deplibs; do
4732 case " $new_libs " in
4734 *) new_libs
="$new_libs $deplib" ;;
4737 *) new_libs
="$new_libs $deplib" ;;
4740 compile_deplibs
="$new_libs"
4743 compile_command
="$compile_command $compile_deplibs"
4744 finalize_command
="$finalize_command $finalize_deplibs"
4746 if test -n "$rpath$xrpath"; then
4747 # If the user specified any rpath flags, then add them.
4748 for libdir
in $rpath $xrpath; do
4749 # This is the magic to use -rpath.
4750 case "$finalize_rpath " in
4752 *) finalize_rpath
="$finalize_rpath $libdir" ;;
4757 # Now hardcode the library paths
4760 for libdir
in $compile_rpath $finalize_rpath; do
4761 if test -n "$hardcode_libdir_flag_spec"; then
4762 if test -n "$hardcode_libdir_separator"; then
4763 if test -z "$hardcode_libdirs"; then
4764 hardcode_libdirs
="$libdir"
4766 # Just accumulate the unique libdirs.
4767 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4768 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4771 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4776 eval flag
=\"$hardcode_libdir_flag_spec\"
4777 rpath
="$rpath $flag"
4779 elif test -n "$runpath_var"; then
4780 case "$perm_rpath " in
4782 *) perm_rpath
="$perm_rpath $libdir" ;;
4786 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
4787 testbindir
=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
4788 case :$dllsearchpath: in
4790 *) dllsearchpath
="$dllsearchpath:$libdir";;
4792 case :$dllsearchpath: in
4793 *":$testbindir:"*) ;;
4794 *) dllsearchpath
="$dllsearchpath:$testbindir";;
4799 # Substitute the hardcoded libdirs into the rpath.
4800 if test -n "$hardcode_libdir_separator" &&
4801 test -n "$hardcode_libdirs"; then
4802 libdir
="$hardcode_libdirs"
4803 eval rpath
=\" $hardcode_libdir_flag_spec\"
4805 compile_rpath
="$rpath"
4809 for libdir
in $finalize_rpath; do
4810 if test -n "$hardcode_libdir_flag_spec"; then
4811 if test -n "$hardcode_libdir_separator"; then
4812 if test -z "$hardcode_libdirs"; then
4813 hardcode_libdirs
="$libdir"
4815 # Just accumulate the unique libdirs.
4816 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4817 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4820 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4825 eval flag
=\"$hardcode_libdir_flag_spec\"
4826 rpath
="$rpath $flag"
4828 elif test -n "$runpath_var"; then
4829 case "$finalize_perm_rpath " in
4831 *) finalize_perm_rpath
="$finalize_perm_rpath $libdir" ;;
4835 # Substitute the hardcoded libdirs into the rpath.
4836 if test -n "$hardcode_libdir_separator" &&
4837 test -n "$hardcode_libdirs"; then
4838 libdir
="$hardcode_libdirs"
4839 eval rpath
=\" $hardcode_libdir_flag_spec\"
4841 finalize_rpath
="$rpath"
4843 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4844 # Transform all the library objects into standard objects.
4845 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4846 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4850 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
4851 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4852 dlsyms
="${outputname}S.c"
4854 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4858 if test -n "$dlsyms"; then
4862 # Discover the nlist of each of the dlfiles.
4863 nlist
="$output_objdir/${outputname}.nm"
4865 $show "$rm $nlist ${nlist}S ${nlist}T"
4866 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4868 # Parse the name list into a source file.
4869 $show "creating $output_objdir/$dlsyms"
4871 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4872 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4873 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4879 /* Prevent the only kind of declaration conflicts we can make. */
4880 #define lt_preloaded_symbols some_other_symbol
4882 /* External symbol declarations for the compiler. */\
4885 if test "$dlself" = yes; then
4886 $show "generating symbol list for \`$output'"
4888 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4890 # Add our own program objects to the symbol list.
4891 progfiles
=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4892 for arg
in $progfiles; do
4893 $show "extracting global C symbols from \`$arg'"
4894 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4897 if test -n "$exclude_expsyms"; then
4898 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4899 $run eval '$mv "$nlist"T "$nlist"'
4902 if test -n "$export_symbols_regex"; then
4903 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4904 $run eval '$mv "$nlist"T "$nlist"'
4907 # Prepare the list of exported symbols
4908 if test -z "$export_symbols"; then
4909 export_symbols
="$output_objdir/$outputname.exp"
4910 $run $rm $export_symbols
4911 $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4913 *cygwin
* |
*mingw
* )
4914 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4915 $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4919 $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4920 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4921 $run eval 'mv "$nlist"T "$nlist"'
4923 *cygwin
* |
*mingw
* )
4924 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4925 $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
4931 for arg
in $dlprefiles; do
4932 $show "extracting global C symbols from \`$arg'"
4933 name
=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4934 $run eval '$echo ": $name " >> "$nlist"'
4935 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4938 if test -z "$run"; then
4939 # Make sure we have at least an empty file.
4940 test -f "$nlist" ||
: > "$nlist"
4942 if test -n "$exclude_expsyms"; then
4943 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4944 $mv "$nlist"T
"$nlist"
4947 # Try sorting and uniquifying the output.
4948 if grep -v "^: " < "$nlist" |
4949 if sort -k 3 </dev
/null
>/dev
/null
2>&1; then
4954 uniq > "$nlist"S
; then
4957 grep -v "^: " < "$nlist" > "$nlist"S
4960 if test -f "$nlist"S
; then
4961 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4963 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4966 $echo >> "$output_objdir/$dlsyms" "\
4968 #undef lt_preloaded_symbols
4970 #if defined (__STDC__) && __STDC__
4971 # define lt_ptr void *
4973 # define lt_ptr char *
4977 /* The mapping between symbol names and symbols. */
4981 *cygwin
* |
*mingw
* )
4982 $echo >> "$output_objdir/$dlsyms" "\
4983 /* DATA imports from DLLs on WIN32 can't be const, because
4984 runtime relocations are performed -- see ld's documentation
4990 $echo >> "$output_objdir/$dlsyms" "\
4997 $echo >> "$output_objdir/$dlsyms" "\
5001 lt_preloaded_symbols[] =
5005 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
5007 $echo >> "$output_objdir/$dlsyms" "\
5011 /* This works around a problem in FreeBSD linker */
5012 #ifdef FREEBSD_WORKAROUND
5013 static const void *lt_preloaded_setup() {
5014 return lt_preloaded_symbols;
5024 pic_flag_for_symtable
=
5026 # compiling the symbol table file with pic_flag works around
5027 # a FreeBSD bug that causes programs to crash when -lm is
5028 # linked before any other PIC object. But we must not use
5029 # pic_flag when linking with -static. The problem exists in
5030 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
5031 *-*-freebsd2*|
*-*-freebsd3.0
*|
*-*-freebsdelf3.0
*)
5032 case "$compile_command " in
5034 *) pic_flag_for_symtable
=" $pic_flag -DFREEBSD_WORKAROUND";;
5037 case "$compile_command " in
5039 *) pic_flag_for_symtable
=" $pic_flag";;
5043 # Now compile the dynamic symbol file.
5044 $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
5045 $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' ||
exit $?
5047 # Clean up the generated files.
5048 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
5049 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
5051 # Transform the symbol file into the correct name.
5053 *cygwin
* |
*mingw
* )
5054 if test -f "$output_objdir/${outputname}.def" ; then
5055 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
5056 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
5058 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
5059 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
5063 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
5064 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
5069 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
5074 # We keep going just in case the user didn't refer to
5075 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
5076 # really was required.
5078 # Nullify the symbol file.
5079 compile_command
=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
5080 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
5083 if test "$need_relink" = no ||
test "$build_libtool_libs" != yes; then
5084 # Replace the output file specification.
5085 compile_command
=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
5086 link_command
="$compile_command$compile_rpath"
5088 # We have no uninstalled library dependencies, so finalize right now.
5089 $show "$link_command"
5090 $run eval "$link_command"
5093 # Delete the generated files.
5094 if test -n "$dlsyms"; then
5095 $show "$rm $output_objdir/${outputname}S.${objext}"
5096 $run $rm "$output_objdir/${outputname}S.${objext}"
5102 if test -n "$shlibpath_var"; then
5103 # We should set the shlibpath_var
5105 for dir
in $temp_rpath; do
5107 [\\/]* |
[A-Za-z
]:[\\/]*)
5112 # Relative path: add a thisdir entry.
5113 rpath
="$rpath\$thisdir/$dir:"
5120 if test -n "$compile_shlibpath$finalize_shlibpath"; then
5121 compile_command
="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
5123 if test -n "$finalize_shlibpath"; then
5124 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
5129 if test -n "$runpath_var"; then
5130 if test -n "$perm_rpath"; then
5131 # We should set the runpath_var.
5133 for dir
in $perm_rpath; do
5136 compile_var
="$runpath_var=\"$rpath\$$runpath_var\" "
5138 if test -n "$finalize_perm_rpath"; then
5139 # We should set the runpath_var.
5141 for dir
in $finalize_perm_rpath; do
5144 finalize_var
="$runpath_var=\"$rpath\$$runpath_var\" "
5148 if test "$no_install" = yes; then
5149 # We don't need to create a wrapper script.
5150 link_command
="$compile_var$compile_command$compile_rpath"
5151 # Replace the output file specification.
5152 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
5153 # Delete the old output file.
5155 # Link the executable and exit
5156 $show "$link_command"
5157 $run eval "$link_command" ||
exit $?
5161 if test "$hardcode_action" = relink
; then
5162 # Fast installation is not supported
5163 link_command
="$compile_var$compile_command$compile_rpath"
5164 relink_command
="$finalize_var$finalize_command$finalize_rpath"
5166 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
5167 $echo "$modename: \`$output' will be relinked during installation" 1>&2
5169 if test "$fast_install" != no
; then
5170 link_command
="$finalize_var$compile_command$finalize_rpath"
5171 if test "$fast_install" = yes; then
5172 relink_command
=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
5174 # fast_install is set to needless
5178 link_command
="$compile_var$compile_command$compile_rpath"
5179 relink_command
="$finalize_var$finalize_command$finalize_rpath"
5183 # Replace the output file specification.
5184 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
5186 # Delete the old output files.
5187 $run $rm $output $output_objdir/$outputname $output_objdir/lt-
$outputname
5189 $show "$link_command"
5190 $run eval "$link_command" ||
exit $?
5192 # Now create the wrapper script.
5193 $show "creating $output"
5195 # Quote the relink command for shipping.
5196 if test -n "$relink_command"; then
5197 # Preserve any variables that may affect compiler behavior
5198 for var
in $variables_saved_for_relink; do
5199 if eval test -z \"\
${$var+set}\"; then
5200 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5201 elif eval var_value
=\$
$var; test -z "$var_value"; then
5202 relink_command
="$var=; export $var; $relink_command"
5204 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5205 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
5208 relink_command
="(cd `pwd`; $relink_command)"
5209 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5212 # Quote $echo for shipping.
5213 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
5215 [\\/]* |
[A-Za-z
]:[\\/]*) qecho
="$SHELL $progpath --fallback-echo";;
5216 *) qecho
="$SHELL `pwd`/$progpath --fallback-echo";;
5218 qecho
=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
5220 qecho
=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
5223 # Only actually do things if our run command is non-null.
5224 if test -z "$run"; then
5225 # win32 will think the script is a binary if it has
5226 # a .exe suffix, so we strip it off here.
5228 *.exe
) output
=`$echo $output|${SED} 's,.exe$,,'` ;;
5230 # test for cygwin because mv fails w/o .exe extensions
5234 outputname
=`$echo $outputname|${SED} 's,.exe$,,'` ;;
5238 *cygwin
* |
*mingw
* )
5239 output_name
=`basename $output`
5240 output_path
=`dirname $output`
5241 cwrappersource
="$output_path/$objdir/lt-$output_name.c"
5242 cwrapper
="$output_path/$output_name.exe"
5243 $rm $cwrappersource $cwrapper
5244 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
5246 cat > $cwrappersource <<EOF
5248 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
5249 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5251 The $output program cannot be directly executed until all the libtool
5252 libraries that it depends on are installed.
5254 This wrapper executable should never be moved out of the build directory.
5255 If it is, it will not operate correctly.
5257 Currently, it simply execs the wrapper *script* "/bin/sh $output",
5258 but could eventually absorb all of the scripts functionality and
5259 exec $objdir/$outputname directly.
5262 cat >> $cwrappersource<<"EOF"
5271 #include <sys/stat.h>
5273 #if defined(PATH_MAX)
5274 # define LT_PATHMAX PATH_MAX
5275 #elif defined(MAXPATHLEN)
5276 # define LT_PATHMAX MAXPATHLEN
5278 # define LT_PATHMAX 1024
5281 #ifndef DIR_SEPARATOR
5282 # define DIR_SEPARATOR '/'
5283 # define PATH_SEPARATOR ':'
5286 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
5288 # define HAVE_DOS_BASED_FILE_SYSTEM
5289 # ifndef DIR_SEPARATOR_2
5290 # define DIR_SEPARATOR_2 '\\'
5292 # ifndef PATH_SEPARATOR_2
5293 # define PATH_SEPARATOR_2 ';'
5297 #ifndef DIR_SEPARATOR_2
5298 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
5299 #else /* DIR_SEPARATOR_2 */
5300 # define IS_DIR_SEPARATOR(ch) \
5301 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
5302 #endif /* DIR_SEPARATOR_2 */
5304 #ifndef PATH_SEPARATOR_2
5305 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
5306 #else /* PATH_SEPARATOR_2 */
5307 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
5308 #endif /* PATH_SEPARATOR_2 */
5310 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
5311 #define XFREE(stale) do { \
5312 if (stale) { free ((void *) stale); stale = 0; } \
5315 /* -DDEBUG is fairly common in CFLAGS. */
5317 #if defined DEBUGWRAPPER
5318 # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
5320 # define DEBUG(format, ...)
5323 const char *program_name = NULL;
5325 void * xmalloc (size_t num);
5326 char * xstrdup (const char *string);
5327 const char * base_name (const char *name);
5328 char * find_executable(const char *wrapper);
5329 int check_executable(const char *path);
5330 char * strendzap(char *str, const char *pat);
5331 void lt_fatal (const char *message, ...);
5334 main (int argc, char *argv[])
5339 program_name = (char *) xstrdup (base_name (argv[0]));
5340 DEBUG("(main) argv[0] : %s\n",argv[0]);
5341 DEBUG("(main) program_name : %s\n",program_name);
5342 newargz = XMALLOC(char *, argc+2);
5345 cat >> $cwrappersource <<EOF
5346 newargz[0] = (char *) xstrdup("$SHELL");
5349 cat >> $cwrappersource <<"EOF"
5350 newargz
[1] = find_executable
(argv
[0]);
5351 if (newargz
[1] == NULL
)
5352 lt_fatal
("Couldn't find %s", argv
[0]);
5353 DEBUG
("(main) found exe at : %s\n",newargz
[1]);
5354 /* we know the
script has the same name
, without the .exe
*/
5355 /* so
make sure newargz
[1] doesn
't end in .exe */
5356 strendzap(newargz[1],".exe");
5357 for (i = 1; i < argc; i++)
5358 newargz[i+1] = xstrdup(argv[i]);
5359 newargz[argc+1] = NULL;
5361 for (i=0; i<argc+1; i++)
5363 DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
5371 cat >> $cwrappersource <<EOF
5372 execv("$SHELL",(char const **)newargz);
5376 cat >> $cwrappersource <<EOF
5377 execv("$SHELL",newargz);
5382 cat >> $cwrappersource <<"EOF"
5387 xmalloc (size_t num)
5389 void * p = (void *) malloc (num);
5391 lt_fatal ("Memory exhausted");
5397 xstrdup (const char *string)
5399 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5404 base_name (const char *name)
5408 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5409 /* Skip over the disk name in MSDOS pathnames. */
5410 if (isalpha ((unsigned char)name[0]) && name[1] == ':')
5414 for (base = name; *name; name++)
5415 if (IS_DIR_SEPARATOR (*name))
5421 check_executable(const char * path)
5425 DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
5426 if ((!path) || (!*path))
5429 if ((stat (path, &st) >= 0) &&
5431 /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
5432 #if defined (S_IXOTH)
5433 ((st.st_mode & S_IXOTH) == S_IXOTH) ||
5435 #if defined (S_IXGRP)
5436 ((st.st_mode & S_IXGRP) == S_IXGRP) ||
5438 ((st.st_mode & S_IXUSR) == S_IXUSR))
5445 /* Searches for the full path of the wrapper. Returns
5446 newly allocated full path name if found, NULL otherwise */
5448 find_executable (const char* wrapper)
5453 /* static buffer for getcwd */
5454 char tmp[LT_PATHMAX + 1];
5458 DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
5460 if ((wrapper == NULL) || (*wrapper == '\
0'))
5463 /* Absolute path? */
5464 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5465 if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
5467 concat_name = xstrdup (wrapper);
5468 if (check_executable(concat_name))
5475 if (IS_DIR_SEPARATOR (wrapper[0]))
5477 concat_name = xstrdup (wrapper);
5478 if (check_executable(concat_name))
5482 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5486 for (p = wrapper; *p; p++)
5494 /* no slashes; search PATH */
5495 const char* path = getenv ("PATH");
5498 for (p = path; *p; p = p_next)
5502 for (q = p; *q; q++)
5503 if (IS_PATH_SEPARATOR(*q))
5506 p_next = (*q == '\
0' ? q : q + 1);
5509 /* empty path: current directory */
5510 if (getcwd (tmp, LT_PATHMAX) == NULL)
5511 lt_fatal ("getcwd failed");
5512 tmp_len = strlen(tmp);
5513 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5514 memcpy (concat_name, tmp, tmp_len);
5515 concat_name[tmp_len] = '/';
5516 strcpy (concat_name + tmp_len + 1, wrapper);
5520 concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
5521 memcpy (concat_name, p, p_len);
5522 concat_name[p_len] = '/';
5523 strcpy (concat_name + p_len + 1, wrapper);
5525 if (check_executable(concat_name))
5530 /* not found in PATH; assume curdir */
5532 /* Relative path | not found in path: prepend cwd */
5533 if (getcwd (tmp, LT_PATHMAX) == NULL)
5534 lt_fatal ("getcwd failed");
5535 tmp_len = strlen(tmp);
5536 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5537 memcpy (concat_name, tmp, tmp_len);
5538 concat_name[tmp_len] = '/';
5539 strcpy (concat_name + tmp_len + 1, wrapper);
5541 if (check_executable(concat_name))
5548 strendzap(char *str, const char *pat)
5552 assert(str != NULL);
5553 assert(pat != NULL);
5556 patlen = strlen(pat);
5560 str += len - patlen;
5561 if (strcmp(str, pat) == 0)
5568 lt_error_core (int exit_status, const char * mode,
5569 const char * message, va_list ap)
5571 fprintf (stderr, "%s: %s: ", program_name, mode);
5572 vfprintf (stderr, message, ap);
5573 fprintf (stderr, ".\n");
5575 if (exit_status >= 0)
5580 lt_fatal (const char *message, ...)
5583 va_start (ap, message);
5584 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5588 # we should really use a build-platform specific compiler
5589 # here, but OTOH, the wrappers (shell script and this C one)
5590 # are only useful if you want to execute the "real" binary.
5591 # Since the "real" binary is built for $host, then this
5592 # wrapper might as well be built for $host, too.
5593 $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
5597 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5602 # $output - temporary wrapper script for $objdir/$outputname
5603 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5605 # The $output program cannot be directly executed until all the libtool
5606 # libraries that it depends on are installed.
5608 # This wrapper script should never be moved out of the build directory.
5609 # If it is, it will not operate correctly.
5611 # Sed substitution that helps us do robust quoting. It backslashifies
5612 # metacharacters that are still active within double-quoted strings.
5613 Xsed='${SED} -e 1s
/^X
//'
5614 sed_quote_subst='$sed_quote_subst'
5616 # The HP-UX ksh and POSIX shell print the target directory to stdout
5618 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5620 relink_command=\"$relink_command\"
5622 # This environment variable determines our operation mode.
5623 if test \"\$libtool_install_magic\" = \"$magic\"; then
5624 # install mode needs the following variable:
5625 notinst_deplibs='$notinst_deplibs'
5627 # When we are sourced in execute mode, \$file and \$echo are already set.
5628 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5631 # Make sure echo works.
5632 if test \"X\$1\" = X--no-reexec; then
5633 # Discard the --no-reexec flag, and continue.
5635 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X
\t'; then
5636 # Yippee, \$echo works!
5639 # Restart under the correct shell, and then maybe \$echo will work.
5640 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5646 # Find the directory that this script lives in.
5647 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's
%/[^
/]*$
%%'\`
5648 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5650 # Follow symbolic links until we get to the real thisdir.
5651 file=\`ls -ld \"\$file\" | ${SED} -n 's
/.
*-> //p
'\`
5652 while test -n \"\$file\"; do
5653 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's
%/[^
/]*\$
%%'\`
5655 # If there was a directory component, then change thisdir.
5656 if test \"x\$destdir\" != \"x\$file\"; then
5657 case \"\$destdir\" in
5658 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5659 *) thisdir=\"\$thisdir/\$destdir\" ;;
5663 file=\`\$echo \"X\$file\" | \$Xsed -e 's
%^.
*/%%'\`
5664 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's
/.
*-> //p
'\`
5667 # Try to get the absolute directory name.
5668 absdir=\`cd \"\$thisdir\" && pwd\`
5669 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5672 if test "$fast_install" = yes; then
5674 program=lt-'$outputname'$exeext
5675 progdir=\"\$thisdir/$objdir\"
5677 if test ! -f \"\$progdir/\$program\" || \\
5678 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5679 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5681 file=\"\$\$-\$program\"
5683 if test ! -d \"\$progdir\"; then
5684 $mkdir \"\$progdir\"
5686 $rm \"\$progdir/\$file\"
5691 # relink executable if necessary
5692 if test -n \"\$relink_command\"; then
5693 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5695 $echo \"\$relink_command_output\" >&2
5696 $rm \"\$progdir/\$file\"
5701 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5702 { $rm \"\$progdir/\$program\";
5703 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5704 $rm \"\$progdir/\$file\"
5708 program='$outputname'
5709 progdir=\"\$thisdir/$objdir\"
5715 if test -f \"\$progdir/\$program\"; then"
5717 # Export our shlibpath_var if we have one.
5718 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5720 # Add our own library path to $shlibpath_var
5721 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5723 # Some systems cannot cope with colon-terminated $shlibpath_var
5724 # The second colon is a workaround for a bug in BeOS R4 sed
5725 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's
/::*\$
//'\`
5727 export $shlibpath_var
5731 # fixup the dll searchpath if we need to.
5732 if test -n "$dllsearchpath"; then
5734 # Add the dll search path components to the executable PATH
5735 PATH=$dllsearchpath:\$PATH
5740 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5741 # Run the actual program with our arguments.
5744 # Backslashes separate directories on plain windows
5745 *-*-mingw | *-*-os2*)
5747 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5753 exec \"\$progdir/\$program\" \${1+\"\$@\"}
5758 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
5762 # The program doesn't exist.
5763 \
$echo \"\
$0: error
: \\\
`\$progdir/\$program' does not exist\" 1>&2
5764 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5765 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5776 # See if we need to build an old-fashioned archive.
5777 for oldlib in $oldlibs; do
5779 if test "$build_libtool_libs" = convenience; then
5780 oldobjs="$libobjs_save"
5781 addlibs="$convenience"
5782 build_libtool_libs=no
5784 if test "$build_libtool_libs" = module; then
5785 oldobjs="$libobjs_save"
5786 build_libtool_libs=no
5788 oldobjs="$old_deplibs $non_pic_objects"
5790 addlibs="$old_convenience"
5793 if test -n "$addlibs"; then
5794 gentop="$output_objdir/${outputname}x"
5795 generated="$generated $gentop"
5797 func_extract_archives $gentop $addlibs
5798 oldobjs="$oldobjs $func_extract_archives_result"
5801 # Do each command in the archive commands.
5802 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5803 cmds=$old_archive_from_new_cmds
5805 # POSIX demands no paths to be encoded in archives. We have
5806 # to avoid creating archives with duplicate basenames if we
5807 # might have to extract them afterwards, e.g., when creating a
5808 # static archive out of a convenience library, or when linking
5809 # the entirety of a libtool archive into another (currently
5810 # not supported by libtool).
5811 if (for obj in $oldobjs
5813 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5814 done | sort | sort -uc >/dev/null 2>&1); then
5817 $echo "copying selected object files to avoid basename conflicts..."
5819 if test -z "$gentop"; then
5820 gentop="$output_objdir/${outputname}x"
5821 generated="$generated $gentop"
5823 $show "${rm}r $gentop"
5824 $run ${rm}r "$gentop"
5825 $show "$mkdir $gentop"
5826 $run $mkdir "$gentop"
5828 if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
5833 save_oldobjs=$oldobjs
5836 for obj in $save_oldobjs
5838 objbase=`$echo "X$obj" |
$Xsed -e 's%^.*/%%'`
5839 case " $oldobjs " in
5840 " ") oldobjs=$obj ;;
5843 # Make sure we don't pick an alternate name that also
5845 newobj=lt$counter-$objbase
5846 counter=`expr $counter + 1`
5847 case " $oldobjs " in
5848 *[\ /]"$newobj "*) ;;
5849 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
5852 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5853 $run ln "$obj" "$gentop/$newobj" ||
5854 $run cp "$obj" "$gentop/$newobj"
5855 oldobjs="$oldobjs $gentop/$newobj"
5857 *) oldobjs="$oldobjs $obj" ;;
5862 eval cmds=\"$old_archive_cmds\"
5864 if len=`expr "X$cmds" : ".*"` &&
5865 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5866 cmds=$old_archive_cmds
5868 # the command line is too long to link in one step, link in parts
5869 $echo "using piecewise archive linking..."
5874 save_oldobjs=$oldobjs
5876 # Is there a better way of finding the last object in the list?
5877 for obj in $save_oldobjs
5881 for obj in $save_oldobjs
5883 oldobjs="$objlist $obj"
5884 objlist="$objlist $obj"
5885 eval test_cmds=\"$old_archive_cmds\"
5886 if len=`expr "X$test_cmds" : ".*" 2>/dev
/null
` &&
5887 test "$len" -le "$max_cmd_len"; then
5890 # the above command should be used before it gets too long
5892 if test "$obj" = "$last_oldobj" ; then
5895 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5896 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5902 if test "X$oldobjs" = "X" ; then
5903 eval cmds=\"\$concat_cmds\"
5905 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5909 save_ifs="$IFS"; IFS='~'
5910 for cmd in $cmds; do
5914 $run eval "$cmd" || exit $?
5919 if test -n "$generated"; then
5920 $show "${rm}r$generated"
5921 $run ${rm}r$generated
5924 # Now create the libtool archive.
5928 test "$build_old_libs" = yes && old_library="$libname.$libext"
5929 $show "creating $output"
5931 # Preserve any variables that may affect compiler behavior
5932 for var in $variables_saved_for_relink; do
5933 if eval test -z \"\${$var+set}\"; then
5934 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5935 elif eval var_value=\$$var; test -z "$var_value"; then
5936 relink_command="$var=; export $var; $relink_command"
5938 var_value=`$echo "X$var_value" |
$Xsed -e "$sed_quote_subst"`
5939 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5942 # Quote the link command for shipping.
5943 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5944 relink_command=`$echo "X$relink_command" |
$Xsed -e "$sed_quote_subst"`
5945 if test "$hardcode_automatic" = yes ; then
5950 # Only create the output if not a dry run.
5951 if test -z "$run"; then
5952 for installed in no yes; do
5953 if test "$installed" = yes; then
5954 if test -z "$install_libdir"; then
5957 output="$output_objdir/$outputname"i
5958 # Replace all uninstalled libtool libraries with the installed ones
5960 for deplib in $dependency_libs; do
5963 name=`$echo "X$deplib" |
$Xsed -e 's%^.*/%%'`
5964 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5965 if test -z "$libdir"; then
5966 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5969 newdependency_libs="$newdependency_libs $libdir/$name"
5971 *) newdependency_libs="$newdependency_libs $deplib" ;;
5974 dependency_libs="$newdependency_libs"
5976 for lib in $dlfiles; do
5977 name=`$echo "X$lib" | $Xsed -e 's
%^.
*/%%'`
5978 eval libdir=`${SED} -n -e 's
/^libdir
=\
(.
*\
)$
/\
1/p
' $lib`
5979 if test -z "$libdir"; then
5980 $echo "$modename: \`$lib' is not a valid libtool archive
" 1>&2
5983 newdlfiles="$newdlfiles $libdir/$name"
5985 dlfiles="$newdlfiles"
5987 for lib in $dlprefiles; do
5988 name=`$echo "X
$lib" | $Xsed -e 's%^.*/%%'`
5989 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5990 if test -z "$libdir"; then
5991 $echo "$modename: \
`$lib' is not a valid libtool archive" 1>&2
5994 newdlprefiles="$newdlprefiles $libdir/$name"
5996 dlprefiles="$newdlprefiles"
5999 for lib in $dlfiles; do
6001 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
6002 *) abs=`pwd`"/$lib" ;;
6004 newdlfiles="$newdlfiles $abs"
6006 dlfiles="$newdlfiles"
6008 for lib in $dlprefiles; do
6010 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
6011 *) abs=`pwd`"/$lib" ;;
6013 newdlprefiles="$newdlprefiles $abs"
6015 dlprefiles="$newdlprefiles"
6018 # place dlname in correct position for cygwin
6020 case $host,$output,$installed,$module,$dlname in
6021 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
6024 # $outputname - a libtool library file
6025 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
6027 # Please DO NOT delete this file!
6028 # It is necessary for linking the library.
6030 # The name that we can dlopen(3).
6033 # Names of this library.
6034 library_names='$library_names'
6036 # The name of the static archive.
6037 old_library='$old_library'
6039 # Libraries that this one depends upon.
6040 dependency_libs='$dependency_libs'
6042 # Version information for $libname.
6047 # Is this an already installed library?
6048 installed=$installed
6050 # Should we warn about portability when linking against -modules?
6051 shouldnotlink=$module
6053 # Files to dlopen/dlpreopen
6055 dlpreopen='$dlprefiles'
6057 # Directory that this library needs to be installed in:
6058 libdir='$install_libdir'"
6059 if test "$installed" = no && test "$need_relink" = yes; then
6061 relink_command=\"$relink_command\""
6066 # Do a symbolic link so that the libtool archive can be found in
6067 # LD_LIBRARY_PATH before the program is installed.
6068 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
6069 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
6075 # libtool install mode
6077 modename="$modename: install"
6079 # There may be an optional sh(1) argument at the beginning of
6080 # install_prog (especially on Windows NT).
6081 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
6082 # Allow the use of GNU shtool's install command.
6083 $echo "X$nonopt" | grep shtool > /dev/null; then
6084 # Aesthetically quote it.
6085 arg=`$echo "X$nonopt" |
$Xsed -e "$sed_quote_subst"`
6087 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6091 install_prog="$arg "
6099 # The real first argument should be the name of the installation program.
6100 # Aesthetically quote it.
6101 arg=`$echo "X$arg" |
$Xsed -e "$sed_quote_subst"`
6103 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6107 install_prog="$install_prog$arg"
6109 # We need to accept at least all the BSD install flags.
6119 if test -n "$dest"; then
6120 files="$files $dest"
6128 case " $install_prog " in
6133 -g | -m | -o) prev=$arg ;;
6141 # If the previous option needed an argument, then skip it.
6142 if test -n "$prev"; then
6151 # Aesthetically quote the argument.
6152 arg=`$echo "X$arg" |
$Xsed -e "$sed_quote_subst"`
6154 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6158 install_prog="$install_prog $arg"
6161 if test -z "$install_prog"; then
6162 $echo "$modename: you must specify an install program" 1>&2
6167 if test -n "$prev"; then
6168 $echo "$modename: the \`$prev' option requires an argument" 1>&2
6173 if test -z "$files"; then
6174 if test -z "$dest"; then
6175 $echo "$modename: no file or destination specified" 1>&2
6177 $echo "$modename: you must specify a destination" 1>&2
6183 # Strip any trailing slash from the destination.
6184 dest=`$echo "X$dest" | $Xsed -e 's
%/$
%%'`
6186 # Check to see that the destination is a directory.
6187 test -d "$dest" && isdir=yes
6188 if test "$isdir" = yes; then
6192 destdir=`$echo "X$dest" | $Xsed -e 's
%/[^
/]*$
%%'`
6193 test "X$destdir" = "X$dest" && destdir=.
6194 destname=`$echo "X$dest" | $Xsed -e 's
%^.
*/%%'`
6196 # Not a directory, so check to see that there is only one file specified.
6198 if test "$#" -gt 2; then
6199 $echo "$modename: \`$dest' is not a directory
" 1>&2
6205 [\\/]* | [A-Za-z]:[\\/]*) ;;
6207 for file in $files; do
6211 $echo "$modename: \
`$destdir' must be an absolute directory name" 1>&2
6220 # This variable tells wrapper scripts just to set variables rather
6221 # than running their programs.
6222 libtool_install_magic="$magic"
6227 for file in $files; do
6229 # Do each installation.
6232 # Do the static libraries later.
6233 staticlibs="$staticlibs $file"
6237 # Check to see that this really is a libtool archive.
6238 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6240 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
6248 # If there is no directory component, then add one.
6250 */* | *\\*) . $file ;;
6254 # Add the libdir to current_libdirs if it is the destination.
6255 if test "X$destdir" = "X$libdir"; then
6256 case "$current_libdirs " in
6258 *) current_libdirs="$current_libdirs $libdir" ;;
6261 # Note the libdir as a future libdir.
6262 case "$future_libdirs " in
6264 *) future_libdirs="$future_libdirs $libdir" ;;
6268 dir=`$echo "X$file" | $Xsed -e 's
%/[^
/]*$
%%'`/
6269 test "X$dir" = "X$file/" && dir=
6272 if test -n "$relink_command"; then
6273 # Determine the prefix the user has applied to our future dir.
6274 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
6276 # Don't allow the user to place us outside of our expected
6277 # location b/c this prevents finding dependent libraries that
6278 # are installed to the same prefix.
6279 # At present, this check doesn't affect windows .dll's that
6280 # are installed into $libdir/../bin (currently, that works fine)
6281 # but it's something to keep an eye on.
6282 if test "$inst_prefix_dir" = "$destdir"; then
6283 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
6287 if test -n "$inst_prefix_dir"; then
6288 # Stick the inst_prefix_dir data into the link command.
6289 relink_command
=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
6291 relink_command
=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
6294 $echo "$modename: warning: relinking \`$file'" 1>&2
6295 $show "$relink_command"
6296 if $run eval "$relink_command"; then :
6298 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6303 # See the names of the shared library.
6304 set dummy
$library_names
6305 if test -n "$2"; then
6311 test -n "$relink_command" && srcname
="$realname"T
6313 # Install the shared library and build the symlinks.
6314 $show "$install_prog $dir/$srcname $destdir/$realname"
6315 $run eval "$install_prog $dir/$srcname $destdir/$realname" ||
exit $?
6316 if test -n "$stripme" && test -n "$striplib"; then
6317 $show "$striplib $destdir/$realname"
6318 $run eval "$striplib $destdir/$realname" ||
exit $?
6321 if test "$#" -gt 0; then
6322 # Delete the old symlinks, and create new ones.
6323 # Try `ln -sf' first, because the `ln' binary might depend on
6324 # the symlink we replace! Solaris /bin/ln does not understand -f,
6325 # so we also need to try rm && ln -s.
6328 if test "$linkname" != "$realname"; then
6329 $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6330 $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6335 # Do each command in the postinstall commands.
6336 lib
="$destdir/$realname"
6337 cmds
=$postinstall_cmds
6338 save_ifs
="$IFS"; IFS
='~'
6339 for cmd
in $cmds; do
6343 $run eval "$cmd" ||
{
6346 # Restore the uninstalled library and exit
6347 if test "$mode" = relink
; then
6348 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
6357 # Install the pseudo-library for information purposes.
6358 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6359 instname
="$dir/$name"i
6360 $show "$install_prog $instname $destdir/$name"
6361 $run eval "$install_prog $instname $destdir/$name" ||
exit $?
6363 # Maybe install the static library, too.
6364 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
6368 # Install (i.e. copy) a libtool object.
6370 # Figure out destination file name, if it wasn't already specified.
6371 if test -n "$destname"; then
6372 destfile
="$destdir/$destname"
6374 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6375 destfile
="$destdir/$destfile"
6378 # Deduce the name of the destination old-style object file.
6381 staticdest
=`$echo "X$destfile" | $Xsed -e "$lo2o"`
6384 staticdest
="$destfile"
6388 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
6394 # Install the libtool object if requested.
6395 if test -n "$destfile"; then
6396 $show "$install_prog $file $destfile"
6397 $run eval "$install_prog $file $destfile" ||
exit $?
6400 # Install the old object if enabled.
6401 if test "$build_old_libs" = yes; then
6402 # Deduce the name of the old-style object file.
6403 staticobj
=`$echo "X$file" | $Xsed -e "$lo2o"`
6405 $show "$install_prog $staticobj $staticdest"
6406 $run eval "$install_prog \$staticobj \$staticdest" ||
exit $?
6412 # Figure out destination file name, if it wasn't already specified.
6413 if test -n "$destname"; then
6414 destfile
="$destdir/$destname"
6416 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6417 destfile
="$destdir/$destfile"
6420 # If the file is missing, and there is a .exe on the end, strip it
6421 # because it is most likely a libtool script we actually want to
6426 if test ! -f "$file"; then
6427 file=`$echo $file|${SED} 's,.exe$,,'`
6433 # Do a test to see if this is really a libtool program.
6436 wrapper
=`$echo $file | ${SED} -e 's,.exe$,,'`
6442 if (${SED} -e '4q' $wrapper |
grep "^# Generated by .*$PACKAGE")>/dev
/null
2>&1; then
6446 # Note that it is not necessary on cygwin/mingw to append a dot to
6447 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6448 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6449 # `FILE.' does not work on cygwin managed mounts.
6451 # If there is no directory component, then add one.
6453 */* |
*\\*) .
${wrapper} ;;
6454 *) . .
/${wrapper} ;;
6457 # Check the variables that should have been set.
6458 if test -z "$notinst_deplibs"; then
6459 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
6464 for lib
in $notinst_deplibs; do
6465 # Check to see that each library is installed.
6467 if test -f "$lib"; then
6468 # If there is no directory component, then add one.
6470 */* |
*\\*) .
$lib ;;
6474 libfile
="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
6475 if test -n "$libdir" && test ! -f "$libfile"; then
6476 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
6482 # Note that it is not necessary on cygwin/mingw to append a dot to
6483 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6484 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6485 # `FILE.' does not work on cygwin managed mounts.
6487 # If there is no directory component, then add one.
6489 */* |
*\\*) .
${wrapper} ;;
6490 *) . .
/${wrapper} ;;
6494 if test "$fast_install" = no
&& test -n "$relink_command"; then
6495 if test "$finalize" = yes && test -z "$run"; then
6496 tmpdir
=`func_mktempdir`
6497 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6498 outputname
="$tmpdir/$file"
6499 # Replace the output file specification.
6500 relink_command
=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
6502 $show "$relink_command"
6503 if $run eval "$relink_command"; then :
6505 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6511 $echo "$modename: warning: cannot relink \`$file'" 1>&2
6514 # Install the binary that we compiled earlier.
6515 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
6519 # remove .exe since cygwin /usr/bin/install will append another
6521 case $install_prog,$host in
6522 */usr
/bin
/install*,*cygwin
*)
6523 case $file:$destfile in
6528 destfile
=$destfile.exe
6531 destfile
=`$echo $destfile | ${SED} -e 's,.exe$,,'`
6536 $show "$install_prog$stripme $file $destfile"
6537 $run eval "$install_prog\$stripme \$file \$destfile" ||
exit $?
6538 test -n "$outputname" && ${rm}r
"$tmpdir"
6543 for file in $staticlibs; do
6544 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6546 # Set up the ranlib parameters.
6547 oldlib
="$destdir/$name"
6549 $show "$install_prog $file $oldlib"
6550 $run eval "$install_prog \$file \$oldlib" ||
exit $?
6552 if test -n "$stripme" && test -n "$old_striplib"; then
6553 $show "$old_striplib $oldlib"
6554 $run eval "$old_striplib $oldlib" ||
exit $?
6557 # Do each command in the postinstall commands.
6558 cmds
=$old_postinstall_cmds
6559 save_ifs
="$IFS"; IFS
='~'
6560 for cmd
in $cmds; do
6564 $run eval "$cmd" ||
exit $?
6569 if test -n "$future_libdirs"; then
6570 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
6573 if test -n "$current_libdirs"; then
6574 # Maybe just do a dry run.
6575 test -n "$run" && current_libdirs
=" -n$current_libdirs"
6576 exec_cmd
='$SHELL $progpath $preserve_args --finish$current_libdirs'
6582 # libtool finish mode
6584 modename
="$modename: finish"
6588 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
6591 libdirs
="$libdirs $dir"
6594 for libdir
in $libdirs; do
6595 if test -n "$finish_cmds"; then
6596 # Do each command in the finish commands.
6598 save_ifs
="$IFS"; IFS
='~'
6599 for cmd
in $cmds; do
6603 $run eval "$cmd" || admincmds
="$admincmds
6608 if test -n "$finish_eval"; then
6609 # Do the single finish_eval.
6610 eval cmds
=\"$finish_eval\"
6611 $run eval "$cmds" || admincmds
="$admincmds
6617 # Exit here if they wanted silent mode.
6618 test "$show" = : && exit $EXIT_SUCCESS
6620 $echo "X----------------------------------------------------------------------" |
$Xsed
6621 $echo "Libraries have been installed in:"
6622 for libdir
in $libdirs; do
6626 $echo "If you ever happen to want to link against installed libraries"
6627 $echo "in a given directory, LIBDIR, you must either use libtool, and"
6628 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6629 $echo "flag during linking and do at least one of the following:"
6630 if test -n "$shlibpath_var"; then
6631 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6632 $echo " during execution"
6634 if test -n "$runpath_var"; then
6635 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
6636 $echo " during linking"
6638 if test -n "$hardcode_libdir_flag_spec"; then
6640 eval flag
=\"$hardcode_libdir_flag_spec\"
6642 $echo " - use the \`$flag' linker flag"
6644 if test -n "$admincmds"; then
6645 $echo " - have your system administrator run these commands:$admincmds"
6647 if test -f /etc
/ld.so.conf
; then
6648 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6651 $echo "See any operating system documentation about shared libraries for"
6652 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6653 $echo "X----------------------------------------------------------------------" |
$Xsed
6657 # libtool execute mode
6659 modename
="$modename: execute"
6661 # The first argument is the command name.
6663 if test -z "$cmd"; then
6664 $echo "$modename: you must specify a COMMAND" 1>&2
6669 # Handle -dlopen flags immediately.
6670 for file in $execute_dlfiles; do
6671 if test ! -f "$file"; then
6672 $echo "$modename: \`$file' is not a file" 1>&2
6680 # Check to see that this really is a libtool archive.
6681 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
6683 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6688 # Read the libtool library.
6692 # If there is no directory component, then add one.
6694 */* |
*\\*) .
$file ;;
6698 # Skip this library if it cannot be dlopened.
6699 if test -z "$dlname"; then
6700 # Warn if it was a shared library.
6701 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6705 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6706 test "X$dir" = "X$file" && dir
=.
6708 if test -f "$dir/$objdir/$dlname"; then
6711 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6717 # Just add the directory containing the .lo file.
6718 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6719 test "X$dir" = "X$file" && dir
=.
6723 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6728 # Get the absolute pathname.
6729 absdir
=`cd "$dir" && pwd`
6730 test -n "$absdir" && dir
="$absdir"
6732 # Now add the directory to shlibpath_var.
6733 if eval "test -z \"\$$shlibpath_var\""; then
6734 eval "$shlibpath_var=\"\$dir\""
6736 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6740 # This variable tells wrapper scripts just to set shlibpath_var
6741 # rather than running their programs.
6742 libtool_execute_magic
="$magic"
6744 # Check if any of the arguments is a wrapper script.
6751 # Do a test to see if this is really a libtool program.
6752 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6753 # If there is no directory component, then add one.
6755 */* |
*\\*) .
$file ;;
6759 # Transform arg to wrapped name.
6760 file="$progdir/$program"
6764 # Quote arguments (to preserve shell metacharacters).
6765 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6766 args
="$args \"$file\""
6769 if test -z "$run"; then
6770 if test -n "$shlibpath_var"; then
6771 # Export the shlibpath_var.
6772 eval "export $shlibpath_var"
6775 # Restore saved environment variables
6776 if test "${save_LC_ALL+set}" = set; then
6777 LC_ALL
="$save_LC_ALL"; export LC_ALL
6779 if test "${save_LANG+set}" = set; then
6780 LANG
="$save_LANG"; export LANG
6783 # Now prepare to actually exec the command.
6784 exec_cmd
="\$cmd$args"
6786 # Display what would be done.
6787 if test -n "$shlibpath_var"; then
6788 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6789 $echo "export $shlibpath_var"
6796 # libtool clean and uninstall mode
6798 modename
="$modename: $mode"
6804 # This variable tells wrapper scripts just to set variables rather
6805 # than running their programs.
6806 libtool_install_magic
="$magic"
6811 -f) rm="$rm $arg"; rmforce
=yes ;;
6812 -*) rm="$rm $arg" ;;
6813 *) files
="$files $arg" ;;
6817 if test -z "$rm"; then
6818 $echo "$modename: you must specify an RM program" 1>&2
6825 origobjdir
="$objdir"
6826 for file in $files; do
6827 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6828 if test "X$dir" = "X$file"; then
6830 objdir
="$origobjdir"
6832 objdir
="$dir/$origobjdir"
6834 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6835 test "$mode" = uninstall
&& objdir
="$dir"
6837 # Remember objdir for removal later, being careful to avoid duplicates
6838 if test "$mode" = clean
; then
6841 *) rmdirs
="$rmdirs $objdir" ;;
6845 # Don't error if the file doesn't exist and rm -f was used.
6846 if (test -L "$file") >/dev
/null
2>&1 \
6847 ||
(test -h "$file") >/dev
/null
2>&1 \
6848 ||
test -f "$file"; then
6850 elif test -d "$file"; then
6853 elif test "$rmforce" = yes; then
6861 # Possibly a libtool archive, so verify it.
6862 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6865 # Delete the libtool libraries and symlinks.
6866 for n
in $library_names; do
6867 rmfiles
="$rmfiles $objdir/$n"
6869 test -n "$old_library" && rmfiles
="$rmfiles $objdir/$old_library"
6873 case " $library_names " in
6874 # " " in the beginning catches empty $dlname
6876 *) rmfiles
="$rmfiles $objdir/$dlname" ;;
6878 test -n "$libdir" && rmfiles
="$rmfiles $objdir/$name $objdir/${name}i"
6881 if test -n "$library_names"; then
6882 # Do each command in the postuninstall commands.
6883 cmds
=$postuninstall_cmds
6884 save_ifs
="$IFS"; IFS
='~'
6885 for cmd
in $cmds; do
6890 if test "$?" -ne 0 && test "$rmforce" != yes; then
6897 if test -n "$old_library"; then
6898 # Do each command in the old_postuninstall commands.
6899 cmds
=$old_postuninstall_cmds
6900 save_ifs
="$IFS"; IFS
='~'
6901 for cmd
in $cmds; do
6906 if test "$?" -ne 0 && test "$rmforce" != yes; then
6912 # FIXME: should reinstall the best remaining shared library.
6919 # Possibly a libtool object, so verify it.
6920 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6925 # Add PIC object to the list of files to remove.
6926 if test -n "$pic_object" \
6927 && test "$pic_object" != none
; then
6928 rmfiles
="$rmfiles $dir/$pic_object"
6931 # Add non-PIC object to the list of files to remove.
6932 if test -n "$non_pic_object" \
6933 && test "$non_pic_object" != none
; then
6934 rmfiles
="$rmfiles $dir/$non_pic_object"
6940 if test "$mode" = clean
; then
6944 file=`$echo $file|${SED} 's,.exe$,,'`
6945 noexename
=`$echo $name|${SED} 's,.exe$,,'`
6946 # $file with .exe has already been added to rmfiles,
6947 # add $file without .exe
6948 rmfiles
="$rmfiles $file"
6951 # Do a test to see if this is a libtool program.
6952 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6956 # note $name still contains .exe if it was in $file originally
6957 # as does the version of $file that was added into $rmfiles
6958 rmfiles
="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6959 if test "$fast_install" = yes && test -n "$relink_command"; then
6960 rmfiles
="$rmfiles $objdir/lt-$name"
6962 if test "X$noexename" != "X$name" ; then
6963 rmfiles
="$rmfiles $objdir/lt-${noexename}.c"
6969 $show "$rm $rmfiles"
6970 $run $rm $rmfiles || exit_status
=1
6972 objdir
="$origobjdir"
6974 # Try to remove the ${objdir}s in the directories where we deleted files
6975 for dir
in $rmdirs; do
6976 if test -d "$dir"; then
6978 $run rmdir $dir >/dev
/null
2>&1
6986 $echo "$modename: you must specify a MODE" 1>&2
6987 $echo "$generic_help" 1>&2
6992 if test -z "$exec_cmd"; then
6993 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6994 $echo "$generic_help" 1>&2
6997 fi # test -z "$show_help"
6999 if test -n "$exec_cmd"; then
7004 # We need to display help for each of the modes.
7007 "Usage: $modename [OPTION]... [MODE-ARG]...
7009 Provide generalized library-building support services.
7011 --config show all configuration variables
7012 --debug enable verbose shell tracing
7013 -n, --dry-run display commands without modifying any files
7014 --features display basic configuration information and exit
7015 --finish same as \`--mode=finish'
7016 --help display this help message and exit
7017 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
7018 --quiet same as \`--silent'
7019 --silent don't print informational messages
7020 --tag=TAG use configuration variables from tag TAG
7021 --version print version information
7023 MODE must be one of the following:
7025 clean remove files from the build directory
7026 compile compile a source file into a libtool object
7027 execute automatically set library path, then run a program
7028 finish complete the installation of libtool libraries
7029 install install libraries or executables
7030 link create a library or an executable
7031 uninstall remove libraries from an installed directory
7033 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
7034 a more detailed description of MODE.
7036 Report bugs to <bug-libtool@gnu.org>."
7042 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
7044 Remove files from the build directory.
7046 RM is the name of the program to use to delete files associated with each FILE
7047 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
7050 If FILE is a libtool library, object or program, all the files associated
7051 with it are deleted. Otherwise, only FILE itself is deleted using RM."
7056 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
7058 Compile a source file into a libtool library object.
7060 This mode accepts the following additional options:
7062 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
7063 -prefer-pic try to building PIC objects only
7064 -prefer-non-pic try to building non-PIC objects only
7065 -static always build a \`.o' file suitable for static linking
7067 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
7068 from the given SOURCEFILE.
7070 The output file name is determined by removing the directory component from
7071 SOURCEFILE, then substituting the C source code suffix \`.c' with the
7072 library object suffix, \`.lo'."
7077 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
7079 Automatically set library path, then run a program.
7081 This mode accepts the following additional options:
7083 -dlopen FILE add the directory containing FILE to the library path
7085 This mode sets the library path environment variable according to \`-dlopen'
7088 If any of the ARGS are libtool executable wrappers, then they are translated
7089 into their corresponding uninstalled binary, and any of their required library
7090 directories are added to the library path.
7092 Then, COMMAND is executed, with ARGS as arguments."
7097 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
7099 Complete the installation of libtool libraries.
7101 Each LIBDIR is a directory that contains libtool libraries.
7103 The commands that this mode executes may require superuser privileges. Use
7104 the \`--dry-run' option if you just want to see what would be executed."
7109 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
7111 Install executables or libraries.
7113 INSTALL-COMMAND is the installation command. The first component should be
7114 either the \`install' or \`cp' program.
7116 The rest of the components are interpreted as arguments to that command (only
7117 BSD-compatible install options are recognized)."
7122 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
7124 Link object files or libraries together to form another library, or to
7125 create an executable program.
7127 LINK-COMMAND is a command using the C compiler that you would use to create
7128 a program from several object files.
7130 The following components of LINK-COMMAND are treated specially:
7132 -all-static do not do any dynamic linking at all
7133 -avoid-version do not add a version suffix if possible
7134 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
7135 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
7136 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
7137 -export-symbols SYMFILE
7138 try to export only the symbols listed in SYMFILE
7139 -export-symbols-regex REGEX
7140 try to export only the symbols matching REGEX
7141 -LLIBDIR search LIBDIR for required installed libraries
7142 -lNAME OUTPUT-FILE requires the installed library libNAME
7143 -module build a library that can dlopened
7144 -no-fast-install disable the fast-install mode
7145 -no-install link a not-installable executable
7146 -no-undefined declare that a library does not refer to external symbols
7147 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
7148 -objectlist FILE Use a list of object files found in FILE to specify objects
7149 -precious-files-regex REGEX
7150 don't remove output files matching REGEX
7151 -release RELEASE specify package release information
7152 -rpath LIBDIR the created library will eventually be installed in LIBDIR
7153 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
7154 -static do not do any dynamic linking of libtool libraries
7155 -version-info CURRENT[:REVISION[:AGE]]
7156 specify library version info [each variable defaults to 0]
7158 All other options (arguments beginning with \`-') are ignored.
7160 Every other argument is treated as a filename. Files ending in \`.la' are
7161 treated as uninstalled libtool libraries, other files are standard or library
7164 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
7165 only library objects (\`.lo' files) may be specified, and \`-rpath' is
7166 required, except when creating a convenience library.
7168 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
7169 using \`ar' and \`ranlib', or on Windows using \`lib'.
7171 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
7172 is created, otherwise an executable program is created."
7177 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
7179 Remove libraries from an installation directory.
7181 RM is the name of the program to use to delete files associated with each FILE
7182 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
7185 If FILE is a libtool library, all the files associated with it are deleted.
7186 Otherwise, only FILE itself is deleted using RM."
7190 $echo "$modename: invalid operation mode \`$mode'" 1>&2
7197 $echo "Try \`$modename --help' for more information about other modes."
7201 # The TAGs below are defined such that we never get into a situation
7202 # in which we disable both kinds of libraries. Given conflicting
7203 # choices, we go for a static library, that is the most portable,
7204 # since we can't tell whether shared libraries were disabled because
7205 # the user asked for that or because the platform doesn't support
7206 # them. This is particularly important on AIX, because we don't
7207 # support having both static and shared libraries enabled at the same
7208 # time on that platform, so we default to a shared-only configuration.
7209 # If a disable-shared tag is given, we'll fallback to a static-only
7210 # configuration. But we'll never go from static-only to shared-only.
7212 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
7214 # ### END LIBTOOL TAG CONFIG: disable-shared
7216 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
7218 # ### END LIBTOOL TAG CONFIG: disable-static
7224 # ### BEGIN LIBTOOL TAG CONFIG: CXX
7226 # Libtool was configured on host ubuntujov:
7228 # Shell to use when invoking shell scripts.
7231 # Whether or not to build shared libraries.
7232 build_libtool_libs
=yes
7234 # Whether or not to build static libraries.
7237 # Whether or not to add -lc for building shared libraries.
7238 build_libtool_need_lc
=no
7240 # Whether or not to disallow shared libs when runtime libs are static
7241 allow_libtool_libs_with_static_runtimes
=no
7243 # Whether or not to optimize for fast installation.
7248 host=i686-pc-linux-gnu
7253 build
=i686-pc-linux-gnu
7256 # An echo program that does not interpret backslashes.
7266 # LTCC compiler flags.
7269 # A language-specific compiler.
7272 # Is the compiler the GNU C compiler?
7276 EGREP
="/bin/grep -E"
7278 # The linker used to build libraries.
7281 # Whether we need hard or soft links.
7284 # A BSD-compatible nm program.
7287 # A symbol stripping program
7290 # Used to examine libraries when file_magic_cmd begins "file"
7293 # Used on cygwin: DLL creation program.
7296 # Used on cygwin: object dumper.
7299 # Used on cygwin: assembler.
7302 # The name of the directory that contains temporary libtool files.
7305 # How to create reloadable object files.
7307 reload_cmds
="\$LD\$reload_flag -o \$output\$reload_objs"
7309 # How to pass a linker flag through the compiler.
7312 # Object file suffix (normally "o").
7315 # Old archive suffix (normally "a").
7318 # Shared library suffix (normally ".so").
7321 # Executable file suffix (normally "").
7324 # Additional compiler flags for building library objects.
7325 pic_flag
=" -fPIC -DPIC"
7328 # What is the maximum length of a command?
7331 # Does compiler simultaneously support -c and -o options?
7334 # Must we lock files when doing compilation?
7337 # Do we need the lib prefix for modules?
7340 # Do we need a version for libraries?
7343 # Whether dlopen is supported.
7344 dlopen_support
=unknown
7346 # Whether dlopen of programs is supported.
7349 # Whether dlopen of statically linked programs is supported.
7350 dlopen_self_static
=unknown
7352 # Compiler flag to prevent dynamic linking.
7353 link_static_flag
="-static"
7355 # Compiler flag to turn off builtin functions.
7356 no_builtin_flag
=" -fno-builtin"
7358 # Compiler flag to allow reflexive dlopens.
7359 export_dynamic_flag_spec
="\${wl}--export-dynamic"
7361 # Compiler flag to generate shared objects directly from archives.
7362 whole_archive_flag_spec
="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
7364 # Compiler flag to generate thread-safe objects.
7365 thread_safe_flag_spec
=""
7367 # Library versioning type.
7370 # Format of library name prefix.
7371 libname_spec
="lib\$name"
7373 # List of archive names. First name is the real one, the rest are links.
7374 # The last name is the one that the linker finds with -lNAME.
7375 library_names_spec
="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
7377 # The coded name of the library, if different from the real name.
7378 soname_spec
="\${libname}\${release}\${shared_ext}\$major"
7380 # Commands used to build and install an old-style archive.
7382 old_archive_cmds
="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
7383 old_postinstall_cmds
="chmod 644 \$oldlib~\$RANLIB \$oldlib"
7384 old_postuninstall_cmds
=""
7386 # Create an old-style archive from a shared archive.
7387 old_archive_from_new_cmds
=""
7389 # Create a temporary old-style archive to link instead of a shared archive.
7390 old_archive_from_expsyms_cmds
=""
7392 # Commands used to build and install a shared archive.
7393 archive_cmds
="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
7394 archive_expsym_cmds
="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
7396 postuninstall_cmds
=""
7398 # Commands used to build a loadable module (assumed same as above if empty)
7400 module_expsym_cmds
=""
7402 # Commands to strip libraries.
7403 old_striplib
="strip --strip-debug"
7404 striplib
="strip --strip-unneeded"
7406 # Dependencies to place before the objects being linked to create a
7408 predep_objects
="/usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../lib/crti.o /usr/lib/gcc/i486-linux-gnu/4.0.3/crtbeginS.o"
7410 # Dependencies to place after the objects being linked to create a
7412 postdep_objects
="/usr/lib/gcc/i486-linux-gnu/4.0.3/crtendS.o /usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../lib/crtn.o"
7414 # Dependencies to place before the objects being linked to create a
7418 # Dependencies to place after the objects being linked to create a
7420 postdeps
="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
7422 # The library search path used internally by the compiler when linking
7424 compiler_lib_search_path
="-L/usr/lib/gcc/i486-linux-gnu/4.0.3 -L/usr/lib/gcc/i486-linux-gnu/4.0.3 -L/usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../lib -L/usr/lib/gcc/i486-linux-gnu/4.0.3/../../.. -L/lib/../lib -L/usr/lib/../lib"
7426 # Method to check whether dependent libraries are shared objects.
7427 deplibs_check_method
="pass_all"
7429 # Command to use when deplibs_check_method == file_magic.
7430 file_magic_cmd
="\$MAGIC_CMD"
7432 # Flag that allows shared libraries with undefined symbols to be built.
7433 allow_undefined_flag
=""
7435 # Flag that forces no undefined symbols.
7436 no_undefined_flag
=""
7438 # Commands used to finish a libtool library installation in a directory.
7439 finish_cmds
="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
7441 # Same as above, but a single script fragment to be evaled but not shown.
7444 # Take the output of nm and produce a listing of raw symbols and C names.
7445 global_symbol_pipe
="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
7447 # Transform the output of nm in a proper C declaration
7448 global_symbol_to_cdecl
="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
7450 # Transform the output of nm in a C name address pair
7451 global_symbol_to_c_name_address
="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
7453 # This is the shared library runtime path variable.
7454 runpath_var
=LD_RUN_PATH
7456 # This is the shared library path variable.
7457 shlibpath_var
=LD_LIBRARY_PATH
7459 # Is shlibpath searched before the hard-coded library search path?
7460 shlibpath_overrides_runpath
=no
7462 # How to hardcode a shared library path into an executable.
7463 hardcode_action
=immediate
7465 # Whether we should hardcode library paths into libraries.
7466 hardcode_into_libs
=yes
7468 # Flag to hardcode $libdir into a binary during linking.
7469 # This must work even if $libdir does not exist.
7470 hardcode_libdir_flag_spec
="\${wl}--rpath \${wl}\$libdir"
7472 # If ld is used when linking, flag to hardcode $libdir into
7473 # a binary during linking. This must work even if $libdir does
7475 hardcode_libdir_flag_spec_ld
=""
7477 # Whether we need a single -rpath flag with a separated argument.
7478 hardcode_libdir_separator
=""
7480 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
7484 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
7488 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
7489 # the resulting binary.
7490 hardcode_shlibpath_var
=unsupported
7492 # Set to yes if building a shared library automatically hardcodes DIR into the library
7493 # and all subsequent libraries and executables linked against it.
7494 hardcode_automatic
=no
7496 # Variables whose values should be saved in libtool wrapper scripts and
7497 # restored at relink time.
7498 variables_saved_for_relink
="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
7500 # Whether libtool must link a program against all its dependency libraries.
7503 # Compile-time system search path for libraries
7504 sys_lib_search_path_spec
=" /usr/lib/gcc/i486-linux-gnu/4.0.3/ /usr/lib/gcc/i486-linux-gnu/4.0.3/ /usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../i486-linux-gnu/lib/i486-linux-gnu/4.0.3/ /usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../i486-linux-gnu/lib/ /usr/lib/gcc/i486-linux-gnu/4.0.3/../../../i486-linux-gnu/4.0.3/ /usr/lib/gcc/i486-linux-gnu/4.0.3/../../../ /lib/i486-linux-gnu/4.0.3/ /lib/ /usr/lib/i486-linux-gnu/4.0.3/ /usr/lib/"
7506 # Run-time system search path for libraries
7507 sys_lib_dlsearch_path_spec
="/lib /usr/lib"
7509 # Fix the shell variable $srcfile for the compiler.
7512 # Set to yes if exported symbols are required.
7513 always_export_symbols
=no
7515 # The commands to list exported symbols.
7516 export_symbols_cmds
="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
7518 # The commands to extract the exported symbol list from a shared archive.
7519 extract_expsyms_cmds
=""
7521 # Symbols that should not be listed in the preloaded symbols.
7524 # Symbols that must always be exported.
7527 # ### END LIBTOOL TAG CONFIG: CXX