3 # libtoolT - Provide generalized library-building support services.
4 # Generated automatically by (GNU LibVNCServer 0.9.7)
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 hazel:
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.
325 link_all_deplibs=unknown
327 # Compile-time system search path for libraries
328 sys_lib_search_path_spec=" /usr/lib/gcc/i486-linux-gnu/4.3.2/ /usr/lib/gcc/i486-linux-gnu/4.3.2/ /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../i486-linux-gnu/lib/i486-linux-gnu/4.3.2/ /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../i486-linux-gnu/lib/../lib/ /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../i486-linux-gnu/4.3.2/ /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib/ /lib/i486-linux-gnu/4.3.2/ /lib/../lib/ /usr/lib/i486-linux-gnu/4.3.2/ /usr/lib/../lib/ /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../i486-linux-gnu/lib/ /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../ /lib/ /usr/lib/"
330 # Run-time system search path for libraries
331 sys_lib_dlsearch_path_spec="/lib /usr/lib /lib/i486-linux-gnu /usr/lib/i486-linux-gnu /usr/local/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`
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" ;;
2437 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2440 if test "$pass" = dlopen; then
2441 # Collect dlpreopened libraries
2442 save_deplibs="$deplibs"
2445 for deplib in $libs; do
2449 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
2450 if test "$linkmode,$pass" = "prog,link"; then
2451 compile_deplibs="$deplib $compile_deplibs"
2452 finalize_deplibs="$deplib $finalize_deplibs"
2454 compiler_flags="$compiler_flags $deplib"
2459 if test "$linkmode" != lib && test "$linkmode" != prog; then
2460 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2463 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2464 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2465 for search_ext in .la $std_shrext .so .a; do
2466 # Search the libtool library
2467 lib="$searchdir/lib${name}${search_ext}"
2468 if test -f "$lib"; then
2469 if test "$search_ext" = ".la"; then
2478 if test "$found" != yes; then
2479 # deplib doesn't seem to be a libtool library
2480 if test "$linkmode,$pass" = "prog,link"; then
2481 compile_deplibs="$deplib $compile_deplibs"
2482 finalize_deplibs="$deplib $finalize_deplibs"
2484 deplibs="$deplib $deplibs"
2485 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2488 else # deplib is a libtool library
2489 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2490 # We need to do some special things here, and not later.
2491 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2492 case " $predeps $postdeps " in
2494 if (${SED} -e '2q' $lib |
2495 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2499 */* | *\\*) . $lib ;;
2502 for l in $old_library $library_names; do
2505 if test "X$ll" = "X$old_library" ; then # only static version available
2507 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2508 test "X$ladir" = "X$lib" && ladir="."
2509 lib=$ladir/$old_library
2510 if test "$linkmode,$pass" = "prog,link"; then
2511 compile_deplibs="$deplib $compile_deplibs"
2512 finalize_deplibs="$deplib $finalize_deplibs"
2514 deplibs="$deplib $deplibs"
2515 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2529 deplibs="$deplib $deplibs"
2530 test "$pass" = conv && continue
2531 newdependency_libs="$deplib $newdependency_libs"
2532 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2535 if test "$pass" = conv; then
2536 deplibs="$deplib $deplibs"
2539 if test "$pass" = scan; then
2540 deplibs="$deplib $deplibs"
2542 compile_deplibs="$deplib $compile_deplibs"
2543 finalize_deplibs="$deplib $finalize_deplibs"
2545 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2548 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2554 if test "$pass" = link; then
2555 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2556 # Make sure the xrpath contains only unique directories.
2559 *) xrpath="$xrpath $dir" ;;
2562 deplibs="$deplib $deplibs"
2565 *.la) lib="$deplib" ;;
2567 if test "$pass" = conv; then
2568 deplibs="$deplib $deplibs"
2574 case $deplibs_check_method in
2576 set dummy $deplibs_check_method
2577 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2578 if eval $echo \"$deplib\" 2>/dev/null \
2580 | $EGREP "$match_pattern_regex" > /dev/null; then
2588 if test "$valid_a_lib" != yes; then
2590 $echo "*** Warning: Trying to link with static lib archive $deplib."
2591 $echo "*** I have the capability to make that library automatically link in when"
2592 $echo "*** you link to this library. But I can only do this if you have a"
2593 $echo "*** shared version of the library, which you do not appear to have"
2594 $echo "*** because the file extensions .$libext of this argument makes me believe"
2595 $echo "*** that it is just a static archive that I should not used here."
2598 $echo "*** Warning: Linking the shared library $output against the"
2599 $echo "*** static library $deplib is not portable!"
2600 deplibs="$deplib $deplibs"
2605 if test "$pass" != link; then
2606 deplibs="$deplib $deplibs"
2608 compile_deplibs="$deplib $compile_deplibs"
2609 finalize_deplibs="$deplib $finalize_deplibs"
2616 if test "$pass" = conv; then
2617 deplibs="$deplib $deplibs"
2618 elif test "$linkmode" = prog; then
2619 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2620 # If there is no dlopen support or we're linking statically,
2621 # we need to preload.
2622 newdlprefiles="$newdlprefiles $deplib"
2623 compile_deplibs="$deplib $compile_deplibs"
2624 finalize_deplibs="$deplib $finalize_deplibs"
2626 newdlfiles="$newdlfiles $deplib"
2636 if test "$found" = yes || test -f "$lib"; then :
2638 $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
2642 # Check to see that this really is a libtool archive.
2643 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2645 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2649 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2650 test "X$ladir" = "X$lib" && ladir="."
2658 # If the library was installed with an old release of libtool,
2659 # it will not redefine variables installed, or shouldnotlink
2667 */* | *\\*) . $lib ;;
2671 if test "$linkmode,$pass" = "lib,link" ||
2672 test "$linkmode,$pass" = "prog,scan" ||
2673 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2674 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2675 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2678 if test "$pass" = conv; then
2679 # Only check for convenience libraries
2680 deplibs="$lib $deplibs"
2681 if test -z "$libdir"; then
2682 if test -z "$old_library"; then
2683 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2686 # It is a libtool convenience library, so add in its objects.
2687 convenience="$convenience $ladir/$objdir/$old_library"
2688 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2690 for deplib in $dependency_libs; do
2691 deplibs="$deplib $deplibs"
2692 if test "X$duplicate_deps" = "Xyes" ; then
2693 case "$tmp_libs " in
2694 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2697 tmp_libs="$tmp_libs $deplib"
2699 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2700 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2707 # Get the name of the library we link against.
2709 for l in $old_library $library_names; do
2712 if test -z "$linklib"; then
2713 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2717 # This library was specified with -dlopen.
2718 if test "$pass" = dlopen; then
2719 if test -z "$libdir"; then
2720 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2723 if test -z "$dlname" ||
2724 test "$dlopen_support" != yes ||
2725 test "$build_libtool_libs" = no; then
2726 # If there is no dlname, no dlopen support or we're linking
2727 # statically, we need to preload. We also need to preload any
2728 # dependent libraries so libltdl's deplib preloader doesn't
2729 # bomb out in the load deplibs phase.
2730 dlprefiles="$dlprefiles $lib $dependency_libs"
2732 newdlfiles="$newdlfiles $lib"
2737 # We need an absolute path.
2739 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2741 abs_ladir=`cd "$ladir" && pwd`
2742 if test -z "$abs_ladir"; then
2743 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2744 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2749 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2751 # Find the relevant object directory and library name.
2752 if test "X$installed" = Xyes; then
2753 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2754 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2762 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2764 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2767 # Remove this search path later
2768 notinst_path="$notinst_path $abs_ladir"
2770 dir="$ladir/$objdir"
2771 absdir="$abs_ladir/$objdir"
2772 # Remove this search path later
2773 notinst_path="$notinst_path $abs_ladir"
2775 fi # $installed = yes
2776 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2778 # This library was specified with -dlpreopen.
2779 if test "$pass" = dlpreopen; then
2780 if test -z "$libdir"; then
2781 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2784 # Prefer using a static library (so that no silly _DYNAMIC symbols
2785 # are required to link).
2786 if test -n "$old_library"; then
2787 newdlprefiles="$newdlprefiles $dir/$old_library"
2788 # Otherwise, use the dlname, so that lt_dlopen finds it.
2789 elif test -n "$dlname"; then
2790 newdlprefiles="$newdlprefiles $dir/$dlname"
2792 newdlprefiles="$newdlprefiles $dir/$linklib"
2794 fi # $pass = dlpreopen
2796 if test -z "$libdir"; then
2797 # Link the convenience library
2798 if test "$linkmode" = lib; then
2799 deplibs="$dir/$old_library $deplibs"
2800 elif test "$linkmode,$pass" = "prog,link"; then
2801 compile_deplibs="$dir/$old_library $compile_deplibs"
2802 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2804 deplibs="$lib $deplibs" # used for prog,scan pass
2810 if test "$linkmode" = prog && test "$pass" != link; then
2811 newlib_search_path="$newlib_search_path $ladir"
2812 deplibs="$lib $deplibs"
2815 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2816 test "$build_libtool_libs" = no; then
2821 for deplib in $dependency_libs; do
2823 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2825 # Need to link against all dependency_libs?
2826 if test "$linkalldeplibs" = yes; then
2827 deplibs="$deplib $deplibs"
2829 # Need to hardcode shared library paths
2830 # or/and link against static libraries
2831 newdependency_libs="$deplib $newdependency_libs"
2833 if test "X$duplicate_deps" = "Xyes" ; then
2834 case "$tmp_libs " in
2835 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2838 tmp_libs="$tmp_libs $deplib"
2841 fi # $linkmode = prog...
2843 if test "$linkmode,$pass" = "prog,link"; then
2844 if test -n "$library_names" &&
2845 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2846 # We need to hardcode the library path
2847 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2848 # Make sure the rpath contains only unique directories.
2849 case "$temp_rpath " in
2852 *) temp_rpath="$temp_rpath $absdir" ;;
2856 # Hardcode the library path.
2857 # Skip directories that are in the system default run-time
2859 case " $sys_lib_dlsearch_path " in
2862 case "$compile_rpath " in
2864 *) compile_rpath="$compile_rpath $absdir"
2868 case " $sys_lib_dlsearch_path " in
2871 case "$finalize_rpath " in
2873 *) finalize_rpath="$finalize_rpath $libdir"
2877 fi # $linkmode,$pass = prog,link...
2879 if test "$alldeplibs" = yes &&
2880 { test "$deplibs_check_method" = pass_all ||
2881 { test "$build_libtool_libs" = yes &&
2882 test -n "$library_names"; }; }; then
2883 # We only need to search for static libraries
2888 link_static=no # Whether the deplib will be linked statically
2889 use_static_libs=$prefer_static_libs
2890 if test "$use_static_libs" = built && test "$installed" = yes ; then
2893 if test -n "$library_names" &&
2894 { test "$use_static_libs" = no || test -z "$old_library"; }; then
2895 if test "$installed" = no; then
2896 notinst_deplibs="$notinst_deplibs $lib"
2899 # This is a shared library
2901 # Warn about portability, can't link against -module's on
2902 # some systems (darwin)
2903 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2905 if test "$linkmode" = prog; then
2906 $echo "*** Warning: Linking the executable $output against the loadable module"
2908 $echo "*** Warning: Linking the shared library $output against the loadable module"
2910 $echo "*** $linklib is not portable!"
2912 if test "$linkmode" = lib &&
2913 test "$hardcode_into_libs" = yes; then
2914 # Hardcode the library path.
2915 # Skip directories that are in the system default run-time
2917 case " $sys_lib_dlsearch_path " in
2920 case "$compile_rpath " in
2922 *) compile_rpath="$compile_rpath $absdir"
2926 case " $sys_lib_dlsearch_path " in
2929 case "$finalize_rpath " in
2931 *) finalize_rpath="$finalize_rpath $libdir"
2937 if test -n "$old_archive_from_expsyms_cmds"; then
2938 # figure out the soname
2939 set dummy $library_names
2942 libname=`eval \\$echo \"$libname_spec\"`
2943 # use dlname if we got it. it's perfectly good, no?
2944 if test -n "$dlname"; then
2946 elif test -n "$soname_spec"; then
2950 major=`expr $current - $age`
2954 eval soname=\"$soname_spec\"
2959 # Make a new name for the extract_expsyms_cmds to use
2961 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2962 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2964 # If the library has no export list, then create one now
2965 if test -f "$output_objdir/$soname-def"; then :
2967 $show "extracting exported symbol list from \`$soname'"
2968 save_ifs="$IFS"; IFS='~'
2969 cmds=$extract_expsyms_cmds
2970 for cmd in $cmds; do
2974 $run eval "$cmd" || exit $?
2980 if test -f "$output_objdir/$newlib"; then :; else
2981 $show "generating import library for \`$soname'"
2982 save_ifs="$IFS"; IFS='~'
2983 cmds=$old_archive_from_expsyms_cmds
2984 for cmd in $cmds; do
2988 $run eval "$cmd" || exit $?
2992 # make sure the library variables are pointing to the new library
2995 fi # test -n "$old_archive_from_expsyms_cmds"
2997 if test "$linkmode" = prog || test "$mode" != relink; then
3002 case $hardcode_action in
3003 immediate | unsupported)
3004 if test "$hardcode_direct" = no; then
3007 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
3008 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
3009 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
3010 *-*-unixware7*) add_dir="-L$dir" ;;
3012 # if the lib is a module then we can not link against
3013 # it, someone is ignoring the new warnings I added
3014 if /usr/bin/file -L $add 2> /dev/null |
3015 $EGREP ": [^:]* bundle" >/dev/null ; then
3016 $echo "** Warning, lib $linklib is a module, not a shared library"
3017 if test -z "$old_library" ; then
3019 $echo "** And there doesn't seem to be a static archive available"
3020 $echo "** The link will probably fail, sorry"
3022 add="$dir/$old_library"
3026 elif test "$hardcode_minus_L" = no; then
3028 *-*-sunos*) add_shlibpath="$dir" ;;
3032 elif test "$hardcode_shlibpath_var" = no; then
3033 add_shlibpath="$dir"
3040 if test "$hardcode_direct" = yes; then
3042 elif test "$hardcode_minus_L" = yes; then
3044 # Try looking first in the location we're being installed to.
3045 if test -n "$inst_prefix_dir"; then
3048 add_dir="$add_dir -L$inst_prefix_dir$libdir"
3053 elif test "$hardcode_shlibpath_var" = yes; then
3054 add_shlibpath="$dir"
3063 if test "$lib_linked" != yes; then
3064 $echo "$modename: configuration error: unsupported hardcode properties"
3068 if test -n "$add_shlibpath"; then
3069 case :$compile_shlibpath: in
3070 *":$add_shlibpath:"*) ;;
3071 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
3074 if test "$linkmode" = prog; then
3075 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
3076 test -n "$add" && compile_deplibs="$add $compile_deplibs"
3078 test -n "$add_dir" && deplibs="$add_dir $deplibs"
3079 test -n "$add" && deplibs="$add $deplibs"
3080 if test "$hardcode_direct" != yes && \
3081 test "$hardcode_minus_L" != yes && \
3082 test "$hardcode_shlibpath_var" = yes; then
3083 case :$finalize_shlibpath: in
3085 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
3091 if test "$linkmode" = prog || test "$mode" = relink; then
3095 # Finalize command for both is simple: just hardcode it.
3096 if test "$hardcode_direct" = yes; then
3097 add="$libdir/$linklib"
3098 elif test "$hardcode_minus_L" = yes; then
3101 elif test "$hardcode_shlibpath_var" = yes; then
3102 case :$finalize_shlibpath: in
3104 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
3107 elif test "$hardcode_automatic" = yes; then
3108 if test -n "$inst_prefix_dir" &&
3109 test -f "$inst_prefix_dir$libdir/$linklib" ; then
3110 add="$inst_prefix_dir$libdir/$linklib"
3112 add="$libdir/$linklib"
3115 # We cannot seem to hardcode it, guess we'll fake it.
3117 # Try looking first in the location we're being installed to.
3118 if test -n "$inst_prefix_dir"; then
3121 add_dir="$add_dir -L$inst_prefix_dir$libdir"
3128 if test "$linkmode" = prog; then
3129 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
3130 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
3132 test -n "$add_dir" && deplibs="$add_dir $deplibs"
3133 test -n "$add" && deplibs="$add $deplibs"
3136 elif test "$linkmode" = prog; then
3137 # Here we assume that one of hardcode_direct or hardcode_minus_L
3138 # is not unsupported. This is valid on all known static and
3140 if test "$hardcode_direct" != unsupported; then
3141 test -n "$old_library" && linklib="$old_library"
3142 compile_deplibs="$dir/$linklib $compile_deplibs"
3143 finalize_deplibs="$dir/$linklib $finalize_deplibs"
3145 compile_deplibs="-l$name -L$dir $compile_deplibs"
3146 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
3148 elif test "$build_libtool_libs" = yes; then
3149 # Not a shared library
3150 if test "$deplibs_check_method" != pass_all; then
3151 # We're trying link a shared library against a static one
3152 # but the system doesn't support it.
3154 # Just print a warning and add the library to dependency_libs so
3155 # that the program can be linked against the static library.
3157 $echo "*** Warning: This system can not link to static lib archive $lib."
3158 $echo "*** I have the capability to make that library automatically link in when"
3159 $echo "*** you link to this library. But I can only do this if you have a"
3160 $echo "*** shared version of the library, which you do not appear to have."
3161 if test "$module" = yes; then
3162 $echo "*** But as you try to build a module library, libtool will still create "
3163 $echo "*** a static module, that should work as long as the dlopening application"
3164 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
3165 if test -z "$global_symbol_pipe"; then
3167 $echo "*** However, this would only work if libtool was able to extract symbol"
3168 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3169 $echo "*** not find such a program. So, this module is probably useless."
3170 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3172 if test "$build_old_libs" = no; then
3173 build_libtool_libs=module
3176 build_libtool_libs=no
3180 deplibs="$dir/$old_library $deplibs"
3183 fi # link shared/static library?
3185 if test "$linkmode" = lib; then
3186 if test -n "$dependency_libs" &&
3187 { test "$hardcode_into_libs" != yes ||
3188 test "$build_old_libs" = yes ||
3189 test "$link_static" = yes; }; then
3190 # Extract -R from dependency_libs
3192 for libdir in $dependency_libs; do
3194 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
3196 *" $temp_xrpath "*) ;;
3197 *) xrpath="$xrpath $temp_xrpath";;
3199 *) temp_deplibs="$temp_deplibs $libdir";;
3202 dependency_libs="$temp_deplibs"
3205 newlib_search_path="$newlib_search_path $absdir"
3206 # Link against this library
3207 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
3208 # ... and its dependency_libs
3210 for deplib in $dependency_libs; do
3211 newdependency_libs="$deplib $newdependency_libs"
3212 if test "X$duplicate_deps" = "Xyes" ; then
3213 case "$tmp_libs " in
3214 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
3217 tmp_libs="$tmp_libs $deplib"
3220 if test "$link_all_deplibs" != no; then
3221 # Add the search paths of all dependency libraries
3222 for deplib in $dependency_libs; do
3224 -L*) path="$deplib" ;;
3226 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
3227 test "X$dir" = "X$deplib" && dir="."
3228 # We need an absolute path.
3230 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
3232 absdir=`cd "$dir" && pwd`
3233 if test -z "$absdir"; then
3234 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
3239 if grep "^installed=no" $deplib > /dev/null; then
3240 path="$absdir/$objdir"
3242 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3243 if test -z "$libdir"; then
3244 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3247 if test "$absdir" != "$libdir"; then
3248 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
3255 # we do not want to link against static libs,
3256 # but need to link against shared
3257 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
3258 if test -n "$deplibrary_names" ; then
3259 for tmp in $deplibrary_names ; do
3262 if test -f "$path/$depdepl" ; then
3263 depdepl="$path/$depdepl"
3265 # do not add paths which are already there
3266 case " $newlib_search_path " in
3268 *) newlib_search_path="$newlib_search_path $path";;
3281 # Again, we only want to link against shared libraries
3282 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
3283 for tmp in $newlib_search_path ; do
3284 if test -f "$tmp/lib$tmp_libs.dylib" ; then
3285 eval depdepl="$tmp/lib$tmp_libs.dylib"
3296 case " $deplibs " in
3298 *) deplibs="$path $deplibs" ;;
3300 case " $deplibs " in
3302 *) deplibs="$depdepl $deplibs" ;;
3305 fi # link_all_deplibs != no
3307 done # for deplib in $libs
3308 dependency_libs="$newdependency_libs"
3309 if test "$pass" = dlpreopen; then
3310 # Link the dlpreopened libraries before other libraries
3311 for deplib in $save_deplibs; do
3312 deplibs="$deplib $deplibs"
3315 if test "$pass" != dlopen; then
3316 if test "$pass" != conv; then
3317 # Make sure lib_search_path contains only unique directories.
3319 for dir in $newlib_search_path; do
3320 case "$lib_search_path " in
3322 *) lib_search_path="$lib_search_path $dir" ;;
3328 if test "$linkmode,$pass" != "prog,link"; then
3331 vars="compile_deplibs finalize_deplibs"
3333 for var in $vars dependency_libs; do
3334 # Add libraries to $var in reverse order
3335 eval tmp_libs=\"\$$var\"
3337 for deplib in $tmp_libs; do
3338 # FIXME: Pedantically, this is the right thing to do, so
3339 # that some nasty dependency loop isn't accidentally
3341 #new_libs="$deplib $new_libs"
3342 # Pragmatically, this seems to cause very few problems in
3345 -L*) new_libs="$deplib $new_libs" ;;
3348 # And here is the reason: when a library appears more
3349 # than once as an explicit dependence of a library, or
3350 # is implicitly linked in more than once by the
3351 # compiler, it is considered special, and multiple
3352 # occurrences thereof are not removed. Compare this
3353 # with having the same library being listed as a
3354 # dependency of multiple other libraries: in this case,
3355 # we know (pedantically, we assume) the library does not
3356 # need to be listed more than once, so we keep only the
3357 # last copy. This is not always right, but it is rare
3358 # enough that we require users that really mean to play
3359 # such unportable linking tricks to link the library
3360 # using -Wl,-lname, so that libtool does not consider it
3361 # for duplicate removal.
3362 case " $specialdeplibs " in
3363 *" $deplib "*) new_libs="$deplib $new_libs" ;;
3365 case " $new_libs " in
3367 *) new_libs="$deplib $new_libs" ;;
3375 for deplib in $new_libs; do
3378 case " $tmp_libs " in
3380 *) tmp_libs="$tmp_libs $deplib" ;;
3383 *) tmp_libs="$tmp_libs $deplib" ;;
3386 eval $var=\"$tmp_libs\"
3389 # Last step: remove runtime libs from dependency_libs
3390 # (they stay in deplibs)
3392 for i in $dependency_libs ; do
3393 case " $predeps $postdeps $compiler_lib_search_path " in
3398 if test -n "$i" ; then
3399 tmp_libs="$tmp_libs $i"
3402 dependency_libs=$tmp_libs
3404 if test "$linkmode" = prog; then
3405 dlfiles="$newdlfiles"
3406 dlprefiles="$newdlprefiles"
3411 if test -n "$deplibs"; then
3412 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
3415 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3416 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3419 if test -n "$rpath"; then
3420 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3423 if test -n "$xrpath"; then
3424 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3427 if test -n "$vinfo"; then
3428 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3431 if test -n "$release"; then
3432 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3435 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3436 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3439 # Now set the variables for building old libraries.
3440 build_libtool_libs=no
3442 objs="$objs$old_deplibs"
3446 # Make sure we only generate libraries of the form `libNAME.la'.
3449 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3450 eval shared_ext=\"$shrext_cmds\"
3451 eval libname=\"$libname_spec\"
3454 if test "$module" = no; then
3455 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3459 if test "$need_lib_prefix" != no; then
3460 # Add the "lib" prefix for modules if required
3461 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3462 eval shared_ext=\"$shrext_cmds\"
3463 eval libname=\"$libname_spec\"
3465 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3470 if test -n "$objs"; then
3471 if test "$deplibs_check_method" != pass_all; then
3472 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3476 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3477 $echo "*** objects $objs is not portable!"
3478 libobjs="$libobjs $objs"
3482 if test "$dlself" != no; then
3483 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3487 if test "$#" -gt 2; then
3488 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3493 if test -z "$rpath"; then
3494 if test "$build_libtool_libs" = yes; then
3495 # Building a libtool convenience library.
3496 # Some compilers have problems with a `.al' extension so
3497 # convenience libraries should have the same extension an
3498 # archive normally would.
3499 oldlibs="$output_objdir/$libname.$libext $oldlibs"
3500 build_libtool_libs=convenience
3504 if test -n "$vinfo"; then
3505 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3508 if test -n "$release"; then
3509 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3513 # Parse the version information argument.
3514 save_ifs="$IFS"; IFS=':'
3515 set dummy $vinfo 0 0 0
3518 if test -n "$8"; then
3519 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3524 # convert absolute version numbers to libtool ages
3525 # this retains compatibility with .la files and attempts
3526 # to make the code below a bit more comprehensible
3528 case $vinfo_number in
3532 number_revision="$4"
3534 # There are really only two kinds -- those that
3535 # use the current revision as the major version
3536 # and those that subtract age and use age as
3537 # a minor version. But, then there is irix
3538 # which has an extra 1 added just for fun
3540 case $version_type in
3541 darwin|linux|osf|windows)
3542 current=`expr $number_major + $number_minor`
3544 revision="$number_revision"
3546 freebsd-aout|freebsd-elf|sunos)
3547 current="$number_major"
3548 revision="$number_minor"
3552 current=`expr $number_major + $number_minor - 1`
3554 revision="$number_minor"
3565 # Check that each of the things are valid numbers.
3567 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]) ;;
3569 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3570 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3576 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]) ;;
3578 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3579 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3585 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]) ;;
3587 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3588 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3593 if test "$age" -gt "$current"; then
3594 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3595 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3599 # Calculate the version variables.
3603 case $version_type in
3607 # Like Linux, but with the current version available in
3608 # verstring for coding it into the library header
3609 major=.`expr $current - $age`
3610 versuffix="$major.$age.$revision"
3611 # Darwin ld doesn't like 0 for these options...
3612 minor_current=`expr $current + 1`
3613 verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3618 versuffix=".$current.$revision";
3623 versuffix=".$current";
3627 major=`expr $current - $age + 1`
3629 case $version_type in
3630 nonstopux) verstring_prefix=nonstopux ;;
3631 *) verstring_prefix=sgi ;;
3633 verstring="$verstring_prefix$major.$revision"
3635 # Add in all the interfaces that we are compatible with.
3637 while test "$loop" -ne 0; do
3638 iface=`expr $revision - $loop`
3639 loop=`expr $loop - 1`
3640 verstring="$verstring_prefix$major.$iface:$verstring"
3643 # Before this point, $major must not contain `.'.
3645 versuffix="$major.$revision"
3649 major=.`expr $current - $age`
3650 versuffix="$major.$age.$revision"
3654 major=.`expr $current - $age`
3655 versuffix=".$current.$age.$revision"
3656 verstring="$current.$age.$revision"
3658 # Add in all the interfaces that we are compatible with.
3660 while test "$loop" -ne 0; do
3661 iface=`expr $current - $loop`
3662 loop=`expr $loop - 1`
3663 verstring="$verstring:${iface}.0"
3666 # Make executables depend on our current version.
3667 verstring="$verstring:${current}.0"
3672 versuffix=".$current.$revision"
3676 # Use '-' rather than '.', since we only want one
3677 # extension on DOS 8.3 filesystems.
3678 major=`expr $current - $age`
3683 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3684 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3689 # Clear the version info if we defaulted, and they specified a release.
3690 if test -z "$vinfo" && test -n "$release"; then
3692 case $version_type in
3694 # we can't check for "0.0" in archive_cmds due to quoting
3695 # problems, so we reset it completely
3702 if test "$need_version" = no; then
3709 # Remove version info from name if versioning should be avoided
3710 if test "$avoid_version" = yes && test "$need_version" = no; then
3716 # Check to see if the archive will have undefined symbols.
3717 if test "$allow_undefined" = yes; then
3718 if test "$allow_undefined_flag" = unsupported; then
3719 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3720 build_libtool_libs=no
3724 # Don't allow undefined symbols.
3725 allow_undefined_flag="$no_undefined_flag"
3729 if test "$mode" != relink; then
3730 # Remove our outputs, but don't remove object files since they
3731 # may have been created when compiling PIC objects.
3733 tempremovelist=`$echo "$output_objdir/*"`
3734 for p in $tempremovelist; do
3738 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3739 if test "X$precious_files_regex" != "X"; then
3740 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3745 removelist="$removelist $p"
3750 if test -n "$removelist"; then
3751 $show "${rm}r $removelist"
3752 $run ${rm}r $removelist
3756 # Now set the variables for building old libraries.
3757 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3758 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3760 # Transform .lo files to .o files.
3761 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3764 # Eliminate all temporary directories.
3765 for path in $notinst_path; do
3766 lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
3767 deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
3768 dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
3771 if test -n "$xrpath"; then
3772 # If the user specified any rpath flags, then add them.
3774 for libdir in $xrpath; do
3775 temp_xrpath="$temp_xrpath -R$libdir"
3776 case "$finalize_rpath " in
3778 *) finalize_rpath="$finalize_rpath $libdir" ;;
3781 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3782 dependency_libs="$temp_xrpath $dependency_libs"
3786 # Make sure dlfiles contains only unique files that won't be dlpreopened
3787 old_dlfiles="$dlfiles"
3789 for lib in $old_dlfiles; do
3790 case " $dlprefiles $dlfiles " in
3792 *) dlfiles="$dlfiles $lib" ;;
3796 # Make sure dlprefiles contains only unique files
3797 old_dlprefiles="$dlprefiles"
3799 for lib in $old_dlprefiles; do
3800 case "$dlprefiles " in
3802 *) dlprefiles="$dlprefiles $lib" ;;
3806 if test "$build_libtool_libs" = yes; then
3807 if test -n "$rpath"; then
3809 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3810 # these systems don't actually have a c library (as such)!
3812 *-*-rhapsody* | *-*-darwin1.[012])
3813 # Rhapsody C library is in the System framework
3814 deplibs="$deplibs -framework System"
3817 # Don't link with libc until the a.out ld.so is fixed.
3819 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3820 # Do not include libc due to us having libc/libc_r.
3822 *-*-sco3.2v5* | *-*-sco5v6*)
3823 # Causes problems with __ctype
3825 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
3826 # Compiler inserts libc in the correct place for threads to work
3829 # Add libc to deplibs on all other systems if necessary.
3830 if test "$build_libtool_need_lc" = "yes"; then
3831 deplibs="$deplibs -lc"
3837 # Transform deplibs into only deplibs that can be linked in shared.
3839 libname_save=$libname
3840 release_save=$release
3841 versuffix_save=$versuffix
3843 # I'm not sure if I'm treating the release correctly. I think
3844 # release should show up in the -l (ie -lgmp5) so we don't want to
3845 # add it in twice. Is that correct?
3851 case $deplibs_check_method in
3853 # Don't check for shared/static. Everything works.
3854 # This might be a little naive. We might want to check
3855 # whether the library exists or not. But this is on
3856 # osf3 & osf4 and I'm not really sure... Just
3857 # implementing what was already the behavior.
3861 # This code stresses the "libraries are programs" paradigm to its
3862 # limits. Maybe even breaks it. We compile a program, linking it
3863 # against the deplibs as a proxy for the library. Then we can check
3864 # whether they linked in statically or dynamically with ldd.
3866 cat > conftest.c <<EOF
3867 int main() { return 0; }
3870 $LTCC $LTCFLAGS -o conftest conftest.c $deplibs
3871 if test "$?" -eq 0 ; then
3872 ldd_output=`ldd conftest`
3873 for i in $deplibs; do
3874 name=`expr $i : '-l\(.*\)'`
3875 # If $name is empty we are operating on a -L argument.
3876 if test "$name" != "" && test "$name" -ne "0"; then
3877 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3878 case " $predeps $postdeps " in
3880 newdeplibs="$newdeplibs $i"
3885 if test -n "$i" ; then
3886 libname=`eval \\$echo \"$libname_spec\"`
3887 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3888 set dummy $deplib_matches
3890 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3891 newdeplibs="$newdeplibs $i"
3895 $echo "*** Warning: dynamic linker does not accept needed library $i."
3896 $echo "*** I have the capability to make that library automatically link in when"
3897 $echo "*** you link to this library. But I can only do this if you have a"
3898 $echo "*** shared version of the library, which I believe you do not have"
3899 $echo "*** because a test_compile did reveal that the linker did not use it for"
3900 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3904 newdeplibs="$newdeplibs $i"
3908 # Error occurred in the first compile. Let's try to salvage
3909 # the situation: Compile a separate program for each library.
3910 for i in $deplibs; do
3911 name=`expr $i : '-l\(.*\)'`
3912 # If $name is empty we are operating on a -L argument.
3913 if test "$name" != "" && test "$name" != "0"; then
3915 $LTCC $LTCFLAGS -o conftest conftest.c $i
3917 if test "$?" -eq 0 ; then
3918 ldd_output=`ldd conftest`
3919 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3920 case " $predeps $postdeps " in
3922 newdeplibs="$newdeplibs $i"
3927 if test -n "$i" ; then
3928 libname=`eval \\$echo \"$libname_spec\"`
3929 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3930 set dummy $deplib_matches
3932 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3933 newdeplibs="$newdeplibs $i"
3937 $echo "*** Warning: dynamic linker does not accept needed library $i."
3938 $echo "*** I have the capability to make that library automatically link in when"
3939 $echo "*** you link to this library. But I can only do this if you have a"
3940 $echo "*** shared version of the library, which you do not appear to have"
3941 $echo "*** because a test_compile did reveal that the linker did not use this one"
3942 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3948 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3949 $echo "*** make it link in! You will probably need to install it or some"
3950 $echo "*** library that it depends on before this library will be fully"
3951 $echo "*** functional. Installing it before continuing would be even better."
3954 newdeplibs="$newdeplibs $i"
3960 set dummy $deplibs_check_method
3961 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3962 for a_deplib in $deplibs; do
3963 name=`expr $a_deplib : '-l\(.*\)'`
3964 # If $name is empty we are operating on a -L argument.
3965 if test "$name" != "" && test "$name" != "0"; then
3966 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3967 case " $predeps $postdeps " in
3969 newdeplibs="$newdeplibs $a_deplib"
3974 if test -n "$a_deplib" ; then
3975 libname=`eval \\$echo \"$libname_spec\"`
3976 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3977 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3978 for potent_lib in $potential_libs; do
3979 # Follow soft links.
3980 if ls -lLd "$potent_lib" 2>/dev/null \
3981 | grep " -> " >/dev/null; then
3984 # The statement above tries to avoid entering an
3985 # endless loop below, in case of cyclic links.
3986 # We might still enter an endless loop, since a link
3987 # loop can be closed while we follow links,
3989 potlib="$potent_lib"
3990 while test -h "$potlib" 2>/dev/null; do
3991 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3993 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3994 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3997 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3999 | $EGREP "$file_magic_regex" > /dev/null; then
4000 newdeplibs="$newdeplibs $a_deplib"
4007 if test -n "$a_deplib" ; then
4010 $echo "*** Warning: linker path does not have real file for library $a_deplib."
4011 $echo "*** I have the capability to make that library automatically link in when"
4012 $echo "*** you link to this library. But I can only do this if you have a"
4013 $echo "*** shared version of the library, which you do not appear to have"
4014 $echo "*** because I did check the linker path looking for a file starting"
4015 if test -z "$potlib" ; then
4016 $echo "*** with $libname but no candidates were found. (...for file magic test)"
4018 $echo "*** with $libname and none of the candidates passed a file format test"
4019 $echo "*** using a file magic. Last file checked: $potlib"
4023 # Add a -L argument.
4024 newdeplibs="$newdeplibs $a_deplib"
4026 done # Gone through all deplibs.
4029 set dummy $deplibs_check_method
4030 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
4031 for a_deplib in $deplibs; do
4032 name=`expr $a_deplib : '-l\(.*\)'`
4033 # If $name is empty we are operating on a -L argument.
4034 if test -n "$name" && test "$name" != "0"; then
4035 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4036 case " $predeps $postdeps " in
4038 newdeplibs="$newdeplibs $a_deplib"
4043 if test -n "$a_deplib" ; then
4044 libname=`eval \\$echo \"$libname_spec\"`
4045 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
4046 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
4047 for potent_lib in $potential_libs; do
4048 potlib="$potent_lib" # see symlink-check above in file_magic test
4049 if eval $echo \"$potent_lib\" 2>/dev/null \
4051 | $EGREP "$match_pattern_regex" > /dev/null; then
4052 newdeplibs="$newdeplibs $a_deplib"
4059 if test -n "$a_deplib" ; then
4062 $echo "*** Warning: linker path does not have real file for library $a_deplib."
4063 $echo "*** I have the capability to make that library automatically link in when"
4064 $echo "*** you link to this library. But I can only do this if you have a"
4065 $echo "*** shared version of the library, which you do not appear to have"
4066 $echo "*** because I did check the linker path looking for a file starting"
4067 if test -z "$potlib" ; then
4068 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
4070 $echo "*** with $libname and none of the candidates passed a file format test"
4071 $echo "*** using a regex pattern. Last file checked: $potlib"
4075 # Add a -L argument.
4076 newdeplibs="$newdeplibs $a_deplib"
4078 done # Gone through all deplibs.
4082 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
4083 -e 's/ -[LR][^ ]*//g'`
4084 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4085 for i in $predeps $postdeps ; do
4086 # can't use Xsed below, because $i might contain '/'
4087 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
4090 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
4091 | grep . >/dev/null; then
4093 if test "X$deplibs_check_method" = "Xnone"; then
4094 $echo "*** Warning: inter-library dependencies are not supported in this platform."
4096 $echo "*** Warning: inter-library dependencies are not known to be supported."
4098 $echo "*** All declared inter-library dependencies are being dropped."
4103 versuffix=$versuffix_save
4105 release=$release_save
4106 libname=$libname_save
4110 *-*-rhapsody* | *-*-darwin1.[012])
4111 # On Rhapsody replace the C library is the System framework
4112 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
4116 if test "$droppeddeps" = yes; then
4117 if test "$module" = yes; then
4119 $echo "*** Warning: libtool could not satisfy all declared inter-library"
4120 $echo "*** dependencies of module $libname. Therefore, libtool will create"
4121 $echo "*** a static module, that should work as long as the dlopening"
4122 $echo "*** application is linked with the -dlopen flag."
4123 if test -z "$global_symbol_pipe"; then
4125 $echo "*** However, this would only work if libtool was able to extract symbol"
4126 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
4127 $echo "*** not find such a program. So, this module is probably useless."
4128 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
4130 if test "$build_old_libs" = no; then
4131 oldlibs="$output_objdir/$libname.$libext"
4132 build_libtool_libs=module
4135 build_libtool_libs=no
4138 $echo "*** The inter-library dependencies that have been dropped here will be"
4139 $echo "*** automatically added whenever a program is linked with this library"
4140 $echo "*** or is declared to -dlopen it."
4142 if test "$allow_undefined" = no; then
4144 $echo "*** Since this library must not contain undefined symbols,"
4145 $echo "*** because either the platform does not support them or"
4146 $echo "*** it was explicitly requested with -no-undefined,"
4147 $echo "*** libtool will only create a static version of it."
4148 if test "$build_old_libs" = no; then
4149 oldlibs="$output_objdir/$libname.$libext"
4150 build_libtool_libs=module
4153 build_libtool_libs=no
4158 # Done checking deplibs!
4163 # move library search paths that coincide with paths to not yet
4164 # installed libraries to the beginning of the library search list
4166 for path in $notinst_path; do
4167 case " $new_libs " in
4168 *" -L$path/$objdir "*) ;;
4170 case " $deplibs " in
4171 *" -L$path/$objdir "*)
4172 new_libs="$new_libs -L$path/$objdir" ;;
4177 for deplib in $deplibs; do
4180 case " $new_libs " in
4182 *) new_libs="$new_libs $deplib" ;;
4185 *) new_libs="$new_libs $deplib" ;;
4191 # All the library-specific variables (install_libdir is set above).
4196 # Test again, we may have decided not to build it any more
4197 if test "$build_libtool_libs" = yes; then
4198 if test "$hardcode_into_libs" = yes; then
4199 # Hardcode the library paths
4202 rpath="$finalize_rpath"
4203 test "$mode" != relink && rpath="$compile_rpath$rpath"
4204 for libdir in $rpath; do
4205 if test -n "$hardcode_libdir_flag_spec"; then
4206 if test -n "$hardcode_libdir_separator"; then
4207 if test -z "$hardcode_libdirs"; then
4208 hardcode_libdirs="$libdir"
4210 # Just accumulate the unique libdirs.
4211 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4212 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4215 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4220 eval flag=\"$hardcode_libdir_flag_spec\"
4221 dep_rpath="$dep_rpath $flag"
4223 elif test -n "$runpath_var"; then
4224 case "$perm_rpath " in
4226 *) perm_rpath="$perm_rpath $libdir" ;;
4230 # Substitute the hardcoded libdirs into the rpath.
4231 if test -n "$hardcode_libdir_separator" &&
4232 test -n "$hardcode_libdirs"; then
4233 libdir="$hardcode_libdirs"
4234 if test -n "$hardcode_libdir_flag_spec_ld"; then
4235 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
4237 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
4240 if test -n "$runpath_var" && test -n "$perm_rpath"; then
4241 # We should set the runpath_var.
4243 for dir in $perm_rpath; do
4246 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
4248 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
4251 shlibpath="$finalize_shlibpath"
4252 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
4253 if test -n "$shlibpath"; then
4254 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
4257 # Get the real and link names of the library.
4258 eval shared_ext=\"$shrext_cmds\"
4259 eval library_names=\"$library_names_spec\"
4260 set dummy $library_names
4264 if test -n "$soname_spec"; then
4265 eval soname=\"$soname_spec\"
4269 if test -z "$dlname"; then
4273 lib="$output_objdir/$realname"
4277 linknames="$linknames $link"
4280 # Use standard objects if they are pic
4281 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4283 # Prepare the list of exported symbols
4284 if test -z "$export_symbols"; then
4285 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
4286 $show "generating symbol list for \`$libname.la'"
4287 export_symbols="$output_objdir/$libname.exp"
4288 $run $rm $export_symbols
4289 cmds=$export_symbols_cmds
4290 save_ifs="$IFS"; IFS='~'
4291 for cmd in $cmds; do
4294 if len=`expr "X$cmd" : ".*"` &&
4295 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4297 $run eval "$cmd" || exit $?
4298 skipped_export=false
4300 # The command line is too long to execute in one step.
4301 $show "using reloadable object file for export list..."
4303 # Break out early, otherwise skipped_export may be
4304 # set to false by a later but shorter cmd.
4309 if test -n "$export_symbols_regex"; then
4310 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
4311 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
4312 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
4313 $run eval '$mv "${export_symbols}T" "$export_symbols"'
4318 if test -n "$export_symbols" && test -n "$include_expsyms"; then
4319 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
4323 for test_deplib in $deplibs; do
4324 case " $convenience " in
4325 *" $test_deplib "*) ;;
4327 tmp_deplibs="$tmp_deplibs $test_deplib"
4331 deplibs="$tmp_deplibs"
4333 if test -n "$convenience"; then
4334 if test -n "$whole_archive_flag_spec"; then
4335 save_libobjs=$libobjs
4336 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4338 gentop="$output_objdir/${outputname}x"
4339 generated="$generated $gentop"
4341 func_extract_archives $gentop $convenience
4342 libobjs="$libobjs $func_extract_archives_result"
4346 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
4347 eval flag=\"$thread_safe_flag_spec\"
4348 linker_flags="$linker_flags $flag"
4351 # Make a backup of the uninstalled library when relinking
4352 if test "$mode" = relink; then
4353 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
4356 # Do each of the archive commands.
4357 if test "$module" = yes && test -n "$module_cmds" ; then
4358 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4359 eval test_cmds=\"$module_expsym_cmds\"
4360 cmds=$module_expsym_cmds
4362 eval test_cmds=\"$module_cmds\"
4366 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4367 eval test_cmds=\"$archive_expsym_cmds\"
4368 cmds=$archive_expsym_cmds
4370 eval test_cmds=\"$archive_cmds\"
4375 if test "X$skipped_export" != "X:" &&
4376 len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4377 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4380 # The command line is too long to link in one step, link piecewise.
4381 $echo "creating reloadable object files..."
4383 # Save the value of $output and $libobjs because we want to
4384 # use them later. If we have whole_archive_flag_spec, we
4385 # want to use save_libobjs as it was before
4386 # whole_archive_flag_spec was expanded, because we can't
4387 # assume the linker understands whole_archive_flag_spec.
4388 # This may have to be revisited, in case too many
4389 # convenience libraries get linked in and end up exceeding
4391 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
4392 save_libobjs=$libobjs
4395 output_la=`$echo "X$output" | $Xsed -e "$basename"`
4397 # Clear the reloadable object creation command queue and
4398 # initialize k to one.
4405 output=$output_objdir/$output_la-${k}.$objext
4406 # Loop over the list of objects to be linked.
4407 for obj in $save_libobjs
4409 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
4410 if test "X$objlist" = X ||
4411 { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4412 test "$len" -le "$max_cmd_len"; }; then
4413 objlist="$objlist $obj"
4415 # The command $test_cmds is almost too long, add a
4416 # command to the queue.
4417 if test "$k" -eq 1 ; then
4418 # The first file doesn't have a previous command to add.
4419 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
4421 # All subsequent reloadable object files will link in
4422 # the last one created.
4423 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
4425 last_robj=$output_objdir/$output_la-${k}.$objext
4427 output=$output_objdir/$output_la-${k}.$objext
4432 # Handle the remaining objects by creating one last
4433 # reloadable object file. All subsequent reloadable object
4434 # files will link in the last one created.
4435 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4436 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
4438 if ${skipped_export-false}; then
4439 $show "generating symbol list for \`$libname.la'"
4440 export_symbols="$output_objdir/$libname.exp"
4441 $run $rm $export_symbols
4443 # Append the command to create the export file.
4444 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
4447 # Set up a command to remove the reloadable object files
4448 # after they are used.
4450 while test "$i" -lt "$k"
4453 delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
4456 $echo "creating a temporary reloadable object file: $output"
4458 # Loop through the commands generated above and execute them.
4459 save_ifs="$IFS"; IFS='~'
4460 for cmd in $concat_cmds; do
4463 $run eval "$cmd" || exit $?
4468 # Restore the value of output.
4471 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4472 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4474 # Expand the library linking commands again to reset the
4475 # value of $libobjs for piecewise linking.
4477 # Do each of the archive commands.
4478 if test "$module" = yes && test -n "$module_cmds" ; then
4479 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4480 cmds=$module_expsym_cmds
4485 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4486 cmds=$archive_expsym_cmds
4492 # Append the command to remove the reloadable object files
4493 # to the just-reset $cmds.
4494 eval cmds=\"\$cmds~\$rm $delfiles\"
4496 save_ifs="$IFS"; IFS='~'
4497 for cmd in $cmds; do
4501 $run eval "$cmd" || {
4504 # Restore the uninstalled library and exit
4505 if test "$mode" = relink; then
4506 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
4514 # Restore the uninstalled library and exit
4515 if test "$mode" = relink; then
4516 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4518 if test -n "$convenience"; then
4519 if test -z "$whole_archive_flag_spec"; then
4520 $show "${rm}r $gentop"
4521 $run ${rm}r "$gentop"
4528 # Create links to the real library.
4529 for linkname in $linknames; do
4530 if test "$realname" != "$linkname"; then
4531 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4532 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4536 # If -module or -export-dynamic was specified, set the dlname.
4537 if test "$module" = yes || test "$export_dynamic" = yes; then
4538 # On all known operating systems, these are identical.
4545 if test -n "$deplibs"; then
4546 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4549 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4550 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4553 if test -n "$rpath"; then
4554 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4557 if test -n "$xrpath"; then
4558 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4561 if test -n "$vinfo"; then
4562 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4565 if test -n "$release"; then
4566 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4571 if test -n "$objs$old_deplibs"; then
4572 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4576 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4584 # Delete the old objects.
4585 $run $rm $obj $libobj
4587 # Objects from convenience libraries. This assumes
4588 # single-version convenience libraries. Whenever we create
4589 # different ones for PIC/non-PIC, this we'll have to duplicate
4593 # reload_cmds runs $LD directly, so let us get rid of
4594 # -Wl from whole_archive_flag_spec
4597 if test -n "$convenience"; then
4598 if test -n "$whole_archive_flag_spec"; then
4599 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
4601 gentop="$output_objdir/${obj}x"
4602 generated="$generated $gentop"
4604 func_extract_archives $gentop $convenience
4605 reload_conv_objs="$reload_objs $func_extract_archives_result"
4609 # Create the old-style object.
4610 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
4614 save_ifs="$IFS"; IFS='~'
4615 for cmd in $cmds; do
4619 $run eval "$cmd" || exit $?
4623 # Exit if we aren't doing a library object file.
4624 if test -z "$libobj"; then
4625 if test -n "$gentop"; then
4626 $show "${rm}r $gentop"
4633 if test "$build_libtool_libs" != yes; then
4634 if test -n "$gentop"; then
4635 $show "${rm}r $gentop"
4639 # Create an invalid libtool object if no PIC, so that we don't
4640 # accidentally link it into a program.
4641 # $show "echo timestamp > $libobj"
4642 # $run eval "echo timestamp > $libobj" || exit $?
4646 if test -n "$pic_flag" || test "$pic_mode" != default; then
4647 # Only do commands if we really have different PIC objects.
4648 reload_objs="$libobjs $reload_conv_objs"
4651 save_ifs="$IFS"; IFS='~'
4652 for cmd in $cmds; do
4656 $run eval "$cmd" || exit $?
4661 if test -n "$gentop"; then
4662 $show "${rm}r $gentop"
4671 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4673 if test -n "$vinfo"; then
4674 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4677 if test -n "$release"; then
4678 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4681 if test "$preload" = yes; then
4682 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4683 test "$dlopen_self_static" = unknown; then
4684 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4689 *-*-rhapsody* | *-*-darwin1.[012])
4690 # On Rhapsody replace the C library is the System framework
4691 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4692 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4698 # Don't allow lazy linking, it breaks C++ global constructors
4699 if test "$tagname" = CXX ; then
4700 compile_command="$compile_command ${wl}-bind_at_load"
4701 finalize_command="$finalize_command ${wl}-bind_at_load"
4707 # move library search paths that coincide with paths to not yet
4708 # installed libraries to the beginning of the library search list
4710 for path in $notinst_path; do
4711 case " $new_libs " in
4712 *" -L$path/$objdir "*) ;;
4714 case " $compile_deplibs " in
4715 *" -L$path/$objdir "*)
4716 new_libs="$new_libs -L$path/$objdir" ;;
4721 for deplib in $compile_deplibs; do
4724 case " $new_libs " in
4726 *) new_libs="$new_libs $deplib" ;;
4729 *) new_libs="$new_libs $deplib" ;;
4732 compile_deplibs="$new_libs"
4735 compile_command="$compile_command $compile_deplibs"
4736 finalize_command="$finalize_command $finalize_deplibs"
4738 if test -n "$rpath$xrpath"; then
4739 # If the user specified any rpath flags, then add them.
4740 for libdir in $rpath $xrpath; do
4741 # This is the magic to use -rpath.
4742 case "$finalize_rpath " in
4744 *) finalize_rpath="$finalize_rpath $libdir" ;;
4749 # Now hardcode the library paths
4752 for libdir in $compile_rpath $finalize_rpath; do
4753 if test -n "$hardcode_libdir_flag_spec"; then
4754 if test -n "$hardcode_libdir_separator"; then
4755 if test -z "$hardcode_libdirs"; then
4756 hardcode_libdirs="$libdir"
4758 # Just accumulate the unique libdirs.
4759 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4760 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4763 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4768 eval flag=\"$hardcode_libdir_flag_spec\"
4769 rpath="$rpath $flag"
4771 elif test -n "$runpath_var"; then
4772 case "$perm_rpath " in
4774 *) perm_rpath="$perm_rpath $libdir" ;;
4778 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4779 testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
4780 case :$dllsearchpath: in
4782 *) dllsearchpath="$dllsearchpath:$libdir";;
4784 case :$dllsearchpath: in
4785 *":$testbindir:"*) ;;
4786 *) dllsearchpath="$dllsearchpath:$testbindir";;
4791 # Substitute the hardcoded libdirs into the rpath.
4792 if test -n "$hardcode_libdir_separator" &&
4793 test -n "$hardcode_libdirs"; then
4794 libdir="$hardcode_libdirs"
4795 eval rpath=\" $hardcode_libdir_flag_spec\"
4797 compile_rpath="$rpath"
4801 for libdir in $finalize_rpath; do
4802 if test -n "$hardcode_libdir_flag_spec"; then
4803 if test -n "$hardcode_libdir_separator"; then
4804 if test -z "$hardcode_libdirs"; then
4805 hardcode_libdirs="$libdir"
4807 # Just accumulate the unique libdirs.
4808 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4809 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4812 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4817 eval flag=\"$hardcode_libdir_flag_spec\"
4818 rpath="$rpath $flag"
4820 elif test -n "$runpath_var"; then
4821 case "$finalize_perm_rpath " in
4823 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4827 # Substitute the hardcoded libdirs into the rpath.
4828 if test -n "$hardcode_libdir_separator" &&
4829 test -n "$hardcode_libdirs"; then
4830 libdir="$hardcode_libdirs"
4831 eval rpath=\" $hardcode_libdir_flag_spec\"
4833 finalize_rpath="$rpath"
4835 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4836 # Transform all the library objects into standard objects.
4837 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4838 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4842 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4843 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4844 dlsyms="${outputname}S.c"
4846 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4850 if test -n "$dlsyms"; then
4854 # Discover the nlist of each of the dlfiles.
4855 nlist="$output_objdir/${outputname}.nm"
4857 $show "$rm $nlist ${nlist}S ${nlist}T"
4858 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4860 # Parse the name list into a source file.
4861 $show "creating $output_objdir/$dlsyms"
4863 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4864 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4865 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4871 /* Prevent the only kind of declaration conflicts we can make. */
4872 #define lt_preloaded_symbols some_other_symbol
4874 /* External symbol declarations for the compiler. */\
4877 if test "$dlself" = yes; then
4878 $show "generating symbol list for \`$output'"
4880 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4882 # Add our own program objects to the symbol list.
4883 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4884 for arg in $progfiles; do
4885 $show "extracting global C symbols from \`$arg'"
4886 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4889 if test -n "$exclude_expsyms"; then
4890 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4891 $run eval '$mv "$nlist"T "$nlist"'
4894 if test -n "$export_symbols_regex"; then
4895 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4896 $run eval '$mv "$nlist"T "$nlist"'
4899 # Prepare the list of exported symbols
4900 if test -z "$export_symbols"; then
4901 export_symbols="$output_objdir/$outputname.exp"
4902 $run $rm $export_symbols
4903 $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4905 *cygwin* | *mingw* )
4906 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4907 $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4911 $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4912 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4913 $run eval 'mv "$nlist"T "$nlist"'
4915 *cygwin* | *mingw* )
4916 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4917 $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
4923 for arg in $dlprefiles; do
4924 $show "extracting global C symbols from \`$arg'"
4925 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4926 $run eval '$echo ": $name " >> "$nlist"'
4927 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4930 if test -z "$run"; then
4931 # Make sure we have at least an empty file.
4932 test -f "$nlist" || : > "$nlist"
4934 if test -n "$exclude_expsyms"; then
4935 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4936 $mv "$nlist"T "$nlist"
4939 # Try sorting and uniquifying the output.
4940 if grep -v "^: " < "$nlist" |
4941 if sort -k 3 </dev/null >/dev/null 2>&1; then
4946 uniq > "$nlist"S; then
4949 grep -v "^: " < "$nlist" > "$nlist"S
4952 if test -f "$nlist"S; then
4953 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4955 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4958 $echo >> "$output_objdir/$dlsyms" "\
4960 #undef lt_preloaded_symbols
4962 #if defined (__STDC__) && __STDC__
4963 # define lt_ptr void *
4965 # define lt_ptr char *
4969 /* The mapping between symbol names and symbols. */
4973 *cygwin* | *mingw* )
4974 $echo >> "$output_objdir/$dlsyms" "\
4975 /* DATA imports from DLLs on WIN32 can't be const, because
4976 runtime relocations are performed -- see ld's documentation
4982 $echo >> "$output_objdir/$dlsyms" "\
4989 $echo >> "$output_objdir/$dlsyms" "\
4993 lt_preloaded_symbols[] =
4997 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4999 $echo >> "$output_objdir/$dlsyms" "\
5003 /* This works around a problem in FreeBSD linker */
5004 #ifdef FREEBSD_WORKAROUND
5005 static const void *lt_preloaded_setup() {
5006 return lt_preloaded_symbols;
5016 pic_flag_for_symtable=
5018 # compiling the symbol table file with pic_flag works around
5019 # a FreeBSD bug that causes programs to crash when -lm is
5020 # linked before any other PIC object. But we must not use
5021 # pic_flag when linking with -static. The problem exists in
5022 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
5023 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
5024 case "$compile_command " in
5026 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
5029 case "$compile_command " in
5031 *) pic_flag_for_symtable=" $pic_flag";;
5035 # Now compile the dynamic symbol file.
5036 $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
5037 $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
5039 # Clean up the generated files.
5040 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
5041 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
5043 # Transform the symbol file into the correct name.
5045 *cygwin* | *mingw* )
5046 if test -f "$output_objdir/${outputname}.def" ; then
5047 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
5048 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
5050 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
5051 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
5055 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
5056 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
5061 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
5066 # We keep going just in case the user didn't refer to
5067 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
5068 # really was required.
5070 # Nullify the symbol file.
5071 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
5072 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
5075 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
5076 # Replace the output file specification.
5077 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
5078 link_command="$compile_command$compile_rpath"
5080 # We have no uninstalled library dependencies, so finalize right now.
5081 $show "$link_command"
5082 $run eval "$link_command"
5085 # Delete the generated files.
5086 if test -n "$dlsyms"; then
5087 $show "$rm $output_objdir/${outputname}S.${objext}"
5088 $run $rm "$output_objdir/${outputname}S.${objext}"
5094 if test -n "$shlibpath_var"; then
5095 # We should set the shlibpath_var
5097 for dir in $temp_rpath; do
5099 [\\/]* | [A-Za-z]:[\\/]*)
5104 # Relative path: add a thisdir entry.
5105 rpath="$rpath\$thisdir/$dir:"
5112 if test -n "$compile_shlibpath$finalize_shlibpath"; then
5113 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
5115 if test -n "$finalize_shlibpath"; then
5116 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
5121 if test -n "$runpath_var"; then
5122 if test -n "$perm_rpath"; then
5123 # We should set the runpath_var.
5125 for dir in $perm_rpath; do
5128 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
5130 if test -n "$finalize_perm_rpath"; then
5131 # We should set the runpath_var.
5133 for dir in $finalize_perm_rpath; do
5136 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
5140 if test "$no_install" = yes; then
5141 # We don't need to create a wrapper script.
5142 link_command="$compile_var$compile_command$compile_rpath"
5143 # Replace the output file specification.
5144 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
5145 # Delete the old output file.
5147 # Link the executable and exit
5148 $show "$link_command"
5149 $run eval "$link_command" || exit $?
5153 if test "$hardcode_action" = relink; then
5154 # Fast installation is not supported
5155 link_command="$compile_var$compile_command$compile_rpath"
5156 relink_command="$finalize_var$finalize_command$finalize_rpath"
5158 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
5159 $echo "$modename: \`$output' will be relinked during installation" 1>&2
5161 if test "$fast_install" != no; then
5162 link_command="$finalize_var$compile_command$finalize_rpath"
5163 if test "$fast_install" = yes; then
5164 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
5166 # fast_install is set to needless
5170 link_command="$compile_var$compile_command$compile_rpath"
5171 relink_command="$finalize_var$finalize_command$finalize_rpath"
5175 # Replace the output file specification.
5176 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
5178 # Delete the old output files.
5179 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
5181 $show "$link_command"
5182 $run eval "$link_command" || exit $?
5184 # Now create the wrapper script.
5185 $show "creating $output"
5187 # Quote the relink command for shipping.
5188 if test -n "$relink_command"; then
5189 # Preserve any variables that may affect compiler behavior
5190 for var in $variables_saved_for_relink; do
5191 if eval test -z \"\${$var+set}\"; then
5192 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5193 elif eval var_value=\$$var; test -z "$var_value"; then
5194 relink_command="$var=; export $var; $relink_command"
5196 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5197 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5200 relink_command="(cd `pwd`; $relink_command)"
5201 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5204 # Quote $echo for shipping.
5205 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
5207 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
5208 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
5210 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
5212 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
5215 # Only actually do things if our run command is non-null.
5216 if test -z "$run"; then
5217 # win32 will think the script is a binary if it has
5218 # a .exe suffix, so we strip it off here.
5220 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
5222 # test for cygwin because mv fails w/o .exe extensions
5226 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
5230 *cygwin* | *mingw* )
5231 output_name=`basename $output`
5232 output_path=`dirname $output`
5233 cwrappersource="$output_path/$objdir/lt-$output_name.c"
5234 cwrapper="$output_path/$output_name.exe"
5235 $rm $cwrappersource $cwrapper
5236 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
5238 cat > $cwrappersource <<EOF
5240 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
5241 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5243 The $output program cannot be directly executed until all the libtool
5244 libraries that it depends on are installed.
5246 This wrapper executable should never be moved out of the build directory.
5247 If it is, it will not operate correctly.
5249 Currently, it simply execs the wrapper *script* "/bin/sh $output",
5250 but could eventually absorb all of the scripts functionality and
5251 exec $objdir/$outputname directly.
5254 cat >> $cwrappersource<<"EOF"
5263 #include <sys/stat.h>
5265 #if defined(PATH_MAX)
5266 # define LT_PATHMAX PATH_MAX
5267 #elif defined(MAXPATHLEN)
5268 # define LT_PATHMAX MAXPATHLEN
5270 # define LT_PATHMAX 1024
5273 #ifndef DIR_SEPARATOR
5274 # define DIR_SEPARATOR '/'
5275 # define PATH_SEPARATOR ':'
5278 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
5280 # define HAVE_DOS_BASED_FILE_SYSTEM
5281 # ifndef DIR_SEPARATOR_2
5282 # define DIR_SEPARATOR_2 '\\'
5284 # ifndef PATH_SEPARATOR_2
5285 # define PATH_SEPARATOR_2 ';'
5289 #ifndef DIR_SEPARATOR_2
5290 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
5291 #else /* DIR_SEPARATOR_2 */
5292 # define IS_DIR_SEPARATOR(ch) \
5293 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
5294 #endif /* DIR_SEPARATOR_2 */
5296 #ifndef PATH_SEPARATOR_2
5297 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
5298 #else /* PATH_SEPARATOR_2 */
5299 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
5300 #endif /* PATH_SEPARATOR_2 */
5302 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
5303 #define XFREE(stale) do { \
5304 if (stale) { free ((void *) stale); stale = 0; } \
5307 /* -DDEBUG is fairly common in CFLAGS. */
5309 #if defined DEBUGWRAPPER
5310 # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
5312 # define DEBUG(format, ...)
5315 const char *program_name = NULL;
5317 void * xmalloc (size_t num);
5318 char * xstrdup (const char *string);
5319 const char * base_name (const char *name);
5320 char * find_executable(const char *wrapper);
5321 int check_executable(const char *path);
5322 char * strendzap(char *str, const char *pat);
5323 void lt_fatal (const char *message, ...);
5326 main (int argc, char *argv[])
5331 program_name = (char *) xstrdup (base_name (argv[0]));
5332 DEBUG("(main) argv[0] : %s\n",argv[0]);
5333 DEBUG("(main) program_name : %s\n",program_name);
5334 newargz = XMALLOC(char *, argc+2);
5337 cat >> $cwrappersource <<EOF
5338 newargz[0] = (char *) xstrdup("$SHELL");
5341 cat >> $cwrappersource <<"EOF"
5342 newargz[1] = find_executable(argv[0]);
5343 if (newargz[1] == NULL)
5344 lt_fatal("Couldn't find %s", argv[0]);
5345 DEBUG("(main) found exe at : %s\n",newargz[1]);
5346 /* we know the script has the same name, without the .exe */
5347 /* so make sure newargz[1] doesn't end in .exe */
5348 strendzap(newargz[1],".exe");
5349 for (i = 1; i < argc; i++)
5350 newargz[i+1] = xstrdup(argv[i]);
5351 newargz[argc+1] = NULL;
5353 for (i=0; i<argc+1; i++)
5355 DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
5363 cat >> $cwrappersource <<EOF
5364 execv("$SHELL",(char const **)newargz);
5368 cat >> $cwrappersource <<EOF
5369 execv("$SHELL",newargz);
5374 cat >> $cwrappersource <<"EOF"
5379 xmalloc (size_t num)
5381 void * p = (void *) malloc (num);
5383 lt_fatal ("Memory exhausted");
5389 xstrdup (const char *string)
5391 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5396 base_name (const char *name)
5400 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5401 /* Skip over the disk name in MSDOS pathnames. */
5402 if (isalpha ((unsigned char)name[0]) && name[1] == ':')
5406 for (base = name; *name; name++)
5407 if (IS_DIR_SEPARATOR (*name))
5413 check_executable(const char * path)
5417 DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
5418 if ((!path) || (!*path))
5421 if ((stat (path, &st) >= 0) &&
5423 /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
5424 #if defined (S_IXOTH)
5425 ((st.st_mode & S_IXOTH) == S_IXOTH) ||
5427 #if defined (S_IXGRP)
5428 ((st.st_mode & S_IXGRP) == S_IXGRP) ||
5430 ((st.st_mode & S_IXUSR) == S_IXUSR))
5437 /* Searches for the full path of the wrapper. Returns
5438 newly allocated full path name if found, NULL otherwise */
5440 find_executable (const char* wrapper)
5445 /* static buffer for getcwd */
5446 char tmp[LT_PATHMAX + 1];
5450 DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
5452 if ((wrapper == NULL) || (*wrapper == '\0'))
5455 /* Absolute path? */
5456 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5457 if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
5459 concat_name = xstrdup (wrapper);
5460 if (check_executable(concat_name))
5467 if (IS_DIR_SEPARATOR (wrapper[0]))
5469 concat_name = xstrdup (wrapper);
5470 if (check_executable(concat_name))
5474 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5478 for (p = wrapper; *p; p++)
5486 /* no slashes; search PATH */
5487 const char* path = getenv ("PATH");
5490 for (p = path; *p; p = p_next)
5494 for (q = p; *q; q++)
5495 if (IS_PATH_SEPARATOR(*q))
5498 p_next = (*q == '\0' ? q : q + 1);
5501 /* empty path: current directory */
5502 if (getcwd (tmp, LT_PATHMAX) == NULL)
5503 lt_fatal ("getcwd failed");
5504 tmp_len = strlen(tmp);
5505 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5506 memcpy (concat_name, tmp, tmp_len);
5507 concat_name[tmp_len] = '/';
5508 strcpy (concat_name + tmp_len + 1, wrapper);
5512 concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
5513 memcpy (concat_name, p, p_len);
5514 concat_name[p_len] = '/';
5515 strcpy (concat_name + p_len + 1, wrapper);
5517 if (check_executable(concat_name))
5522 /* not found in PATH; assume curdir */
5524 /* Relative path | not found in path: prepend cwd */
5525 if (getcwd (tmp, LT_PATHMAX) == NULL)
5526 lt_fatal ("getcwd failed");
5527 tmp_len = strlen(tmp);
5528 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5529 memcpy (concat_name, tmp, tmp_len);
5530 concat_name[tmp_len] = '/';
5531 strcpy (concat_name + tmp_len + 1, wrapper);
5533 if (check_executable(concat_name))
5540 strendzap(char *str, const char *pat)
5544 assert(str != NULL);
5545 assert(pat != NULL);
5548 patlen = strlen(pat);
5552 str += len - patlen;
5553 if (strcmp(str, pat) == 0)
5560 lt_error_core (int exit_status, const char * mode,
5561 const char * message, va_list ap)
5563 fprintf (stderr, "%s: %s: ", program_name, mode);
5564 vfprintf (stderr, message, ap);
5565 fprintf (stderr, ".\n");
5567 if (exit_status >= 0)
5572 lt_fatal (const char *message, ...)
5575 va_start (ap, message);
5576 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5580 # we should really use a build-platform specific compiler
5581 # here, but OTOH, the wrappers (shell script and this C one)
5582 # are only useful if you want to execute the "real" binary.
5583 # Since the "real" binary is built for $host, then this
5584 # wrapper might as well be built for $host, too.
5585 $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
5589 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5594 # $output - temporary wrapper script for $objdir/$outputname
5595 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5597 # The $output program cannot be directly executed until all the libtool
5598 # libraries that it depends on are installed.
5600 # This wrapper script should never be moved out of the build directory.
5601 # If it is, it will not operate correctly.
5603 # Sed substitution that helps us do robust quoting. It backslashifies
5604 # metacharacters that are still active within double-quoted strings.
5605 Xsed='${SED} -e 1s/^X//'
5606 sed_quote_subst='$sed_quote_subst'
5608 # The HP-UX ksh and POSIX shell print the target directory to stdout
5610 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5612 relink_command=\"$relink_command\"
5614 # This environment variable determines our operation mode.
5615 if test \"\$libtool_install_magic\" = \"$magic\"; then
5616 # install mode needs the following variable:
5617 notinst_deplibs='$notinst_deplibs'
5619 # When we are sourced in execute mode, \$file and \$echo are already set.
5620 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5623 # Make sure echo works.
5624 if test \"X\$1\" = X--no-reexec; then
5625 # Discard the --no-reexec flag, and continue.
5627 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
5628 # Yippee, \$echo works!
5631 # Restart under the correct shell, and then maybe \$echo will work.
5632 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5638 # Find the directory that this script lives in.
5639 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
5640 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5642 # Follow symbolic links until we get to the real thisdir.
5643 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
5644 while test -n \"\$file\"; do
5645 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
5647 # If there was a directory component, then change thisdir.
5648 if test \"x\$destdir\" != \"x\$file\"; then
5649 case \"\$destdir\" in
5650 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5651 *) thisdir=\"\$thisdir/\$destdir\" ;;
5655 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
5656 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
5659 # Try to get the absolute directory name.
5660 absdir=\`cd \"\$thisdir\" && pwd\`
5661 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5664 if test "$fast_install" = yes; then
5666 program=lt-'$outputname'$exeext
5667 progdir=\"\$thisdir/$objdir\"
5669 if test ! -f \"\$progdir/\$program\" || \\
5670 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5671 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5673 file=\"\$\$-\$program\"
5675 if test ! -d \"\$progdir\"; then
5676 $mkdir \"\$progdir\"
5678 $rm \"\$progdir/\$file\"
5683 # relink executable if necessary
5684 if test -n \"\$relink_command\"; then
5685 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5687 $echo \"\$relink_command_output\" >&2
5688 $rm \"\$progdir/\$file\"
5693 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5694 { $rm \"\$progdir/\$program\";
5695 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5696 $rm \"\$progdir/\$file\"
5700 program='$outputname'
5701 progdir=\"\$thisdir/$objdir\"
5707 if test -f \"\$progdir/\$program\"; then"
5709 # Export our shlibpath_var if we have one.
5710 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5712 # Add our own library path to $shlibpath_var
5713 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5715 # Some systems cannot cope with colon-terminated $shlibpath_var
5716 # The second colon is a workaround for a bug in BeOS R4 sed
5717 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5719 export $shlibpath_var
5723 # fixup the dll searchpath if we need to.
5724 if test -n "$dllsearchpath"; then
5726 # Add the dll search path components to the executable PATH
5727 PATH=$dllsearchpath:\$PATH
5732 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5733 # Run the actual program with our arguments.
5736 # Backslashes separate directories on plain windows
5737 *-*-mingw | *-*-os2*)
5739 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5745 exec \"\$progdir/\$program\" \${1+\"\$@\"}
5750 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
5754 # The program doesn't exist.
5755 \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
5756 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5757 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5768 # See if we need to build an old-fashioned archive.
5769 for oldlib in $oldlibs; do
5771 if test "$build_libtool_libs" = convenience; then
5772 oldobjs="$libobjs_save"
5773 addlibs="$convenience"
5774 build_libtool_libs=no
5776 if test "$build_libtool_libs" = module; then
5777 oldobjs="$libobjs_save"
5778 build_libtool_libs=no
5780 oldobjs="$old_deplibs $non_pic_objects"
5782 addlibs="$old_convenience"
5785 if test -n "$addlibs"; then
5786 gentop="$output_objdir/${outputname}x"
5787 generated="$generated $gentop"
5789 func_extract_archives $gentop $addlibs
5790 oldobjs="$oldobjs $func_extract_archives_result"
5793 # Do each command in the archive commands.
5794 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5795 cmds=$old_archive_from_new_cmds
5797 # POSIX demands no paths to be encoded in archives. We have
5798 # to avoid creating archives with duplicate basenames if we
5799 # might have to extract them afterwards, e.g., when creating a
5800 # static archive out of a convenience library, or when linking
5801 # the entirety of a libtool archive into another (currently
5802 # not supported by libtool).
5803 if (for obj in $oldobjs
5805 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5806 done | sort | sort -uc >/dev/null 2>&1); then
5809 $echo "copying selected object files to avoid basename conflicts..."
5811 if test -z "$gentop"; then
5812 gentop="$output_objdir/${outputname}x"
5813 generated="$generated $gentop"
5815 $show "${rm}r $gentop"
5816 $run ${rm}r "$gentop"
5817 $show "$mkdir $gentop"
5818 $run $mkdir "$gentop"
5820 if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
5825 save_oldobjs=$oldobjs
5828 for obj in $save_oldobjs
5830 objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
5831 case " $oldobjs " in
5832 " ") oldobjs=$obj ;;
5835 # Make sure we don't pick an alternate name that also
5837 newobj=lt$counter-$objbase
5838 counter=`expr $counter + 1`
5839 case " $oldobjs " in
5840 *[\ /]"$newobj "*) ;;
5841 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
5844 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5845 $run ln "$obj" "$gentop/$newobj" ||
5846 $run cp "$obj" "$gentop/$newobj"
5847 oldobjs="$oldobjs $gentop/$newobj"
5849 *) oldobjs="$oldobjs $obj" ;;
5854 eval cmds=\"$old_archive_cmds\"
5856 if len=`expr "X$cmds" : ".*"` &&
5857 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5858 cmds=$old_archive_cmds
5860 # the command line is too long to link in one step, link in parts
5861 $echo "using piecewise archive linking..."
5866 save_oldobjs=$oldobjs
5868 # Is there a better way of finding the last object in the list?
5869 for obj in $save_oldobjs
5873 for obj in $save_oldobjs
5875 oldobjs="$objlist $obj"
5876 objlist="$objlist $obj"
5877 eval test_cmds=\"$old_archive_cmds\"
5878 if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
5879 test "$len" -le "$max_cmd_len"; then
5882 # the above command should be used before it gets too long
5884 if test "$obj" = "$last_oldobj" ; then
5887 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5888 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5894 if test "X$oldobjs" = "X" ; then
5895 eval cmds=\"\$concat_cmds\"
5897 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5901 save_ifs="$IFS"; IFS='~'
5902 for cmd in $cmds; do
5906 $run eval "$cmd" || exit $?
5911 if test -n "$generated"; then
5912 $show "${rm}r$generated"
5913 $run ${rm}r$generated
5916 # Now create the libtool archive.
5920 test "$build_old_libs" = yes && old_library="$libname.$libext"
5921 $show "creating $output"
5923 # Preserve any variables that may affect compiler behavior
5924 for var in $variables_saved_for_relink; do
5925 if eval test -z \"\${$var+set}\"; then
5926 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5927 elif eval var_value=\$$var; test -z "$var_value"; then
5928 relink_command="$var=; export $var; $relink_command"
5930 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5931 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5934 # Quote the link command for shipping.
5935 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5936 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5937 if test "$hardcode_automatic" = yes ; then
5942 # Only create the output if not a dry run.
5943 if test -z "$run"; then
5944 for installed in no yes; do
5945 if test "$installed" = yes; then
5946 if test -z "$install_libdir"; then
5949 output="$output_objdir/$outputname"i
5950 # Replace all uninstalled libtool libraries with the installed ones
5952 for deplib in $dependency_libs; do
5955 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5956 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5957 if test -z "$libdir"; then
5958 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5961 newdependency_libs="$newdependency_libs $libdir/$name"
5963 *) newdependency_libs="$newdependency_libs $deplib" ;;
5966 dependency_libs="$newdependency_libs"
5968 for lib in $dlfiles; do
5969 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5970 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5971 if test -z "$libdir"; then
5972 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5975 newdlfiles="$newdlfiles $libdir/$name"
5977 dlfiles="$newdlfiles"
5979 for lib in $dlprefiles; do
5980 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5981 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5982 if test -z "$libdir"; then
5983 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5986 newdlprefiles="$newdlprefiles $libdir/$name"
5988 dlprefiles="$newdlprefiles"
5991 for lib in $dlfiles; do
5993 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5994 *) abs=`pwd`"/$lib" ;;
5996 newdlfiles="$newdlfiles $abs"
5998 dlfiles="$newdlfiles"
6000 for lib in $dlprefiles; do
6002 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
6003 *) abs=`pwd`"/$lib" ;;
6005 newdlprefiles="$newdlprefiles $abs"
6007 dlprefiles="$newdlprefiles"
6010 # place dlname in correct position for cygwin
6012 case $host,$output,$installed,$module,$dlname in
6013 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
6016 # $outputname - a libtool library file
6017 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
6019 # Please DO NOT delete this file!
6020 # It is necessary for linking the library.
6022 # The name that we can dlopen(3).
6025 # Names of this library.
6026 library_names='$library_names'
6028 # The name of the static archive.
6029 old_library='$old_library'
6031 # Libraries that this one depends upon.
6032 dependency_libs='$dependency_libs'
6034 # Version information for $libname.
6039 # Is this an already installed library?
6040 installed=$installed
6042 # Should we warn about portability when linking against -modules?
6043 shouldnotlink=$module
6045 # Files to dlopen/dlpreopen
6047 dlpreopen='$dlprefiles'
6049 # Directory that this library needs to be installed in:
6050 libdir='$install_libdir'"
6051 if test "$installed" = no && test "$need_relink" = yes; then
6053 relink_command=\"$relink_command\""
6058 # Do a symbolic link so that the libtool archive can be found in
6059 # LD_LIBRARY_PATH before the program is installed.
6060 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
6061 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
6067 # libtool install mode
6069 modename="$modename: install"
6071 # There may be an optional sh(1) argument at the beginning of
6072 # install_prog (especially on Windows NT).
6073 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
6074 # Allow the use of GNU shtool's install command.
6075 $echo "X$nonopt" | grep shtool > /dev/null; then
6076 # Aesthetically quote it.
6077 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
6079 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6083 install_prog="$arg "
6091 # The real first argument should be the name of the installation program.
6092 # Aesthetically quote it.
6093 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
6095 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6099 install_prog="$install_prog$arg"
6101 # We need to accept at least all the BSD install flags.
6111 if test -n "$dest"; then
6112 files="$files $dest"
6120 case " $install_prog " in
6125 -g | -m | -o) prev=$arg ;;
6133 # If the previous option needed an argument, then skip it.
6134 if test -n "$prev"; then
6143 # Aesthetically quote the argument.
6144 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
6146 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6150 install_prog="$install_prog $arg"
6153 if test -z "$install_prog"; then
6154 $echo "$modename: you must specify an install program" 1>&2
6159 if test -n "$prev"; then
6160 $echo "$modename: the \`$prev' option requires an argument" 1>&2
6165 if test -z "$files"; then
6166 if test -z "$dest"; then
6167 $echo "$modename: no file or destination specified" 1>&2
6169 $echo "$modename: you must specify a destination" 1>&2
6175 # Strip any trailing slash from the destination.
6176 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
6178 # Check to see that the destination is a directory.
6179 test -d "$dest" && isdir=yes
6180 if test "$isdir" = yes; then
6184 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
6185 test "X$destdir" = "X$dest" && destdir=.
6186 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
6188 # Not a directory, so check to see that there is only one file specified.
6190 if test "$#" -gt 2; then
6191 $echo "$modename: \`$dest' is not a directory" 1>&2
6197 [\\/]* | [A-Za-z]:[\\/]*) ;;
6199 for file in $files; do
6203 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
6212 # This variable tells wrapper scripts just to set variables rather
6213 # than running their programs.
6214 libtool_install_magic="$magic"
6219 for file in $files; do
6221 # Do each installation.
6224 # Do the static libraries later.
6225 staticlibs="$staticlibs $file"
6229 # Check to see that this really is a libtool archive.
6230 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6232 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
6240 # If there is no directory component, then add one.
6242 */* | *\\*) . $file ;;
6246 # Add the libdir to current_libdirs if it is the destination.
6247 if test "X$destdir" = "X$libdir"; then
6248 case "$current_libdirs " in
6250 *) current_libdirs="$current_libdirs $libdir" ;;
6253 # Note the libdir as a future libdir.
6254 case "$future_libdirs " in
6256 *) future_libdirs="$future_libdirs $libdir" ;;
6260 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
6261 test "X$dir" = "X$file/" && dir=
6264 if test -n "$relink_command"; then
6265 # Determine the prefix the user has applied to our future dir.
6266 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
6268 # Don't allow the user to place us outside of our expected
6269 # location b/c this prevents finding dependent libraries that
6270 # are installed to the same prefix.
6271 # At present, this check doesn't affect windows .dll's that
6272 # are installed into $libdir/../bin (currently, that works fine)
6273 # but it's something to keep an eye on.
6274 if test "$inst_prefix_dir" = "$destdir"; then
6275 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
6279 if test -n "$inst_prefix_dir"; then
6280 # Stick the inst_prefix_dir data into the link command.
6281 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
6283 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
6286 $echo "$modename: warning: relinking \`$file'" 1>&2
6287 $show "$relink_command"
6288 if $run eval "$relink_command"; then :
6290 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6295 # See the names of the shared library.
6296 set dummy $library_names
6297 if test -n "$2"; then
6303 test -n "$relink_command" && srcname="$realname"T
6305 # Install the shared library and build the symlinks.
6306 $show "$install_prog $dir/$srcname $destdir/$realname"
6307 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
6308 if test -n "$stripme" && test -n "$striplib"; then
6309 $show "$striplib $destdir/$realname"
6310 $run eval "$striplib $destdir/$realname" || exit $?
6313 if test "$#" -gt 0; then
6314 # Delete the old symlinks, and create new ones.
6315 # Try `ln -sf' first, because the `ln' binary might depend on
6316 # the symlink we replace! Solaris /bin/ln does not understand -f,
6317 # so we also need to try rm && ln -s.
6320 if test "$linkname" != "$realname"; then
6321 $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6322 $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6327 # Do each command in the postinstall commands.
6328 lib="$destdir/$realname"
6329 cmds=$postinstall_cmds
6330 save_ifs="$IFS"; IFS='~'
6331 for cmd in $cmds; do
6335 $run eval "$cmd" || {
6338 # Restore the uninstalled library and exit
6339 if test "$mode" = relink; then
6340 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
6349 # Install the pseudo-library for information purposes.
6350 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6351 instname="$dir/$name"i
6352 $show "$install_prog $instname $destdir/$name"
6353 $run eval "$install_prog $instname $destdir/$name" || exit $?
6355 # Maybe install the static library, too.
6356 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
6360 # Install (i.e. copy) a libtool object.
6362 # Figure out destination file name, if it wasn't already specified.
6363 if test -n "$destname"; then
6364 destfile="$destdir/$destname"
6366 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6367 destfile="$destdir/$destfile"
6370 # Deduce the name of the destination old-style object file.
6373 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
6376 staticdest="$destfile"
6380 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
6386 # Install the libtool object if requested.
6387 if test -n "$destfile"; then
6388 $show "$install_prog $file $destfile"
6389 $run eval "$install_prog $file $destfile" || exit $?
6392 # Install the old object if enabled.
6393 if test "$build_old_libs" = yes; then
6394 # Deduce the name of the old-style object file.
6395 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
6397 $show "$install_prog $staticobj $staticdest"
6398 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
6404 # Figure out destination file name, if it wasn't already specified.
6405 if test -n "$destname"; then
6406 destfile="$destdir/$destname"
6408 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6409 destfile="$destdir/$destfile"
6412 # If the file is missing, and there is a .exe on the end, strip it
6413 # because it is most likely a libtool script we actually want to
6418 if test ! -f "$file"; then
6419 file=`$echo $file|${SED} 's,.exe$,,'`
6425 # Do a test to see if this is really a libtool program.
6428 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
6434 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
6438 # Note that it is not necessary on cygwin/mingw to append a dot to
6439 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6440 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6441 # `FILE.' does not work on cygwin managed mounts.
6443 # If there is no directory component, then add one.
6445 */* | *\\*) . ${wrapper} ;;
6446 *) . ./${wrapper} ;;
6449 # Check the variables that should have been set.
6450 if test -z "$notinst_deplibs"; then
6451 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
6456 for lib in $notinst_deplibs; do
6457 # Check to see that each library is installed.
6459 if test -f "$lib"; then
6460 # If there is no directory component, then add one.
6462 */* | *\\*) . $lib ;;
6466 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
6467 if test -n "$libdir" && test ! -f "$libfile"; then
6468 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
6474 # Note that it is not necessary on cygwin/mingw to append a dot to
6475 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6476 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6477 # `FILE.' does not work on cygwin managed mounts.
6479 # If there is no directory component, then add one.
6481 */* | *\\*) . ${wrapper} ;;
6482 *) . ./${wrapper} ;;
6486 if test "$fast_install" = no && test -n "$relink_command"; then
6487 if test "$finalize" = yes && test -z "$run"; then
6488 tmpdir=`func_mktempdir`
6489 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6490 outputname="$tmpdir/$file"
6491 # Replace the output file specification.
6492 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
6494 $show "$relink_command"
6495 if $run eval "$relink_command"; then :
6497 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6503 $echo "$modename: warning: cannot relink \`$file'" 1>&2
6506 # Install the binary that we compiled earlier.
6507 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
6511 # remove .exe since cygwin /usr/bin/install will append another
6513 case $install_prog,$host in
6514 */usr/bin/install*,*cygwin*)
6515 case $file:$destfile in
6520 destfile=$destfile.exe
6523 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
6528 $show "$install_prog$stripme $file $destfile"
6529 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
6530 test -n "$outputname" && ${rm}r "$tmpdir"
6535 for file in $staticlibs; do
6536 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6538 # Set up the ranlib parameters.
6539 oldlib="$destdir/$name"
6541 $show "$install_prog $file $oldlib"
6542 $run eval "$install_prog \$file \$oldlib" || exit $?
6544 if test -n "$stripme" && test -n "$old_striplib"; then
6545 $show "$old_striplib $oldlib"
6546 $run eval "$old_striplib $oldlib" || exit $?
6549 # Do each command in the postinstall commands.
6550 cmds=$old_postinstall_cmds
6551 save_ifs="$IFS"; IFS='~'
6552 for cmd in $cmds; do
6556 $run eval "$cmd" || exit $?
6561 if test -n "$future_libdirs"; then
6562 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
6565 if test -n "$current_libdirs"; then
6566 # Maybe just do a dry run.
6567 test -n "$run" && current_libdirs=" -n$current_libdirs"
6568 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
6574 # libtool finish mode
6576 modename="$modename: finish"
6580 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
6583 libdirs="$libdirs $dir"
6586 for libdir in $libdirs; do
6587 if test -n "$finish_cmds"; then
6588 # Do each command in the finish commands.
6590 save_ifs="$IFS"; IFS='~'
6591 for cmd in $cmds; do
6595 $run eval "$cmd" || admincmds="$admincmds
6600 if test -n "$finish_eval"; then
6601 # Do the single finish_eval.
6602 eval cmds=\"$finish_eval\"
6603 $run eval "$cmds" || admincmds="$admincmds
6609 # Exit here if they wanted silent mode.
6610 test "$show" = : && exit $EXIT_SUCCESS
6612 $echo "X----------------------------------------------------------------------" | $Xsed
6613 $echo "Libraries have been installed in:"
6614 for libdir in $libdirs; do
6618 $echo "If you ever happen to want to link against installed libraries"
6619 $echo "in a given directory, LIBDIR, you must either use libtool, and"
6620 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6621 $echo "flag during linking and do at least one of the following:"
6622 if test -n "$shlibpath_var"; then
6623 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6624 $echo " during execution"
6626 if test -n "$runpath_var"; then
6627 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
6628 $echo " during linking"
6630 if test -n "$hardcode_libdir_flag_spec"; then
6632 eval flag=\"$hardcode_libdir_flag_spec\"
6634 $echo " - use the \`$flag' linker flag"
6636 if test -n "$admincmds"; then
6637 $echo " - have your system administrator run these commands:$admincmds"
6639 if test -f /etc/ld.so.conf; then
6640 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6643 $echo "See any operating system documentation about shared libraries for"
6644 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6645 $echo "X----------------------------------------------------------------------" | $Xsed
6649 # libtool execute mode
6651 modename="$modename: execute"
6653 # The first argument is the command name.
6655 if test -z "$cmd"; then
6656 $echo "$modename: you must specify a COMMAND" 1>&2
6661 # Handle -dlopen flags immediately.
6662 for file in $execute_dlfiles; do
6663 if test ! -f "$file"; then
6664 $echo "$modename: \`$file' is not a file" 1>&2
6672 # Check to see that this really is a libtool archive.
6673 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6675 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6680 # Read the libtool library.
6684 # If there is no directory component, then add one.
6686 */* | *\\*) . $file ;;
6690 # Skip this library if it cannot be dlopened.
6691 if test -z "$dlname"; then
6692 # Warn if it was a shared library.
6693 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6697 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6698 test "X$dir" = "X$file" && dir=.
6700 if test -f "$dir/$objdir/$dlname"; then
6703 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6709 # Just add the directory containing the .lo file.
6710 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6711 test "X$dir" = "X$file" && dir=.
6715 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6720 # Get the absolute pathname.
6721 absdir=`cd "$dir" && pwd`
6722 test -n "$absdir" && dir="$absdir"
6724 # Now add the directory to shlibpath_var.
6725 if eval "test -z \"\$$shlibpath_var\""; then
6726 eval "$shlibpath_var=\"\$dir\""
6728 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6732 # This variable tells wrapper scripts just to set shlibpath_var
6733 # rather than running their programs.
6734 libtool_execute_magic="$magic"
6736 # Check if any of the arguments is a wrapper script.
6743 # Do a test to see if this is really a libtool program.
6744 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6745 # If there is no directory component, then add one.
6747 */* | *\\*) . $file ;;
6751 # Transform arg to wrapped name.
6752 file="$progdir/$program"
6756 # Quote arguments (to preserve shell metacharacters).
6757 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6758 args="$args \"$file\""
6761 if test -z "$run"; then
6762 if test -n "$shlibpath_var"; then
6763 # Export the shlibpath_var.
6764 eval "export $shlibpath_var"
6767 # Restore saved environment variables
6768 if test "${save_LC_ALL+set}" = set; then
6769 LC_ALL="$save_LC_ALL"; export LC_ALL
6771 if test "${save_LANG+set}" = set; then
6772 LANG="$save_LANG"; export LANG
6775 # Now prepare to actually exec the command.
6776 exec_cmd="\$cmd$args"
6778 # Display what would be done.
6779 if test -n "$shlibpath_var"; then
6780 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6781 $echo "export $shlibpath_var"
6788 # libtool clean and uninstall mode
6790 modename="$modename: $mode"
6796 # This variable tells wrapper scripts just to set variables rather
6797 # than running their programs.
6798 libtool_install_magic="$magic"
6803 -f) rm="$rm $arg"; rmforce=yes ;;
6804 -*) rm="$rm $arg" ;;
6805 *) files="$files $arg" ;;
6809 if test -z "$rm"; then
6810 $echo "$modename: you must specify an RM program" 1>&2
6817 origobjdir="$objdir"
6818 for file in $files; do
6819 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6820 if test "X$dir" = "X$file"; then
6822 objdir="$origobjdir"
6824 objdir="$dir/$origobjdir"
6826 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6827 test "$mode" = uninstall && objdir="$dir"
6829 # Remember objdir for removal later, being careful to avoid duplicates
6830 if test "$mode" = clean; then
6833 *) rmdirs="$rmdirs $objdir" ;;
6837 # Don't error if the file doesn't exist and rm -f was used.
6838 if (test -L "$file") >/dev/null 2>&1 \
6839 || (test -h "$file") >/dev/null 2>&1 \
6840 || test -f "$file"; then
6842 elif test -d "$file"; then
6845 elif test "$rmforce" = yes; then
6853 # Possibly a libtool archive, so verify it.
6854 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6857 # Delete the libtool libraries and symlinks.
6858 for n in $library_names; do
6859 rmfiles="$rmfiles $objdir/$n"
6861 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6865 case " $library_names " in
6866 # " " in the beginning catches empty $dlname
6868 *) rmfiles="$rmfiles $objdir/$dlname" ;;
6870 test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6873 if test -n "$library_names"; then
6874 # Do each command in the postuninstall commands.
6875 cmds=$postuninstall_cmds
6876 save_ifs="$IFS"; IFS='~'
6877 for cmd in $cmds; do
6882 if test "$?" -ne 0 && test "$rmforce" != yes; then
6889 if test -n "$old_library"; then
6890 # Do each command in the old_postuninstall commands.
6891 cmds=$old_postuninstall_cmds
6892 save_ifs="$IFS"; IFS='~'
6893 for cmd in $cmds; do
6898 if test "$?" -ne 0 && test "$rmforce" != yes; then
6904 # FIXME: should reinstall the best remaining shared library.
6911 # Possibly a libtool object, so verify it.
6912 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6917 # Add PIC object to the list of files to remove.
6918 if test -n "$pic_object" \
6919 && test "$pic_object" != none; then
6920 rmfiles="$rmfiles $dir/$pic_object"
6923 # Add non-PIC object to the list of files to remove.
6924 if test -n "$non_pic_object" \
6925 && test "$non_pic_object" != none; then
6926 rmfiles="$rmfiles $dir/$non_pic_object"
6932 if test "$mode" = clean ; then
6936 file=`$echo $file|${SED} 's,.exe$,,'`
6937 noexename=`$echo $name|${SED} 's,.exe$,,'`
6938 # $file with .exe has already been added to rmfiles,
6939 # add $file without .exe
6940 rmfiles="$rmfiles $file"
6943 # Do a test to see if this is a libtool program.
6944 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6948 # note $name still contains .exe if it was in $file originally
6949 # as does the version of $file that was added into $rmfiles
6950 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6951 if test "$fast_install" = yes && test -n "$relink_command"; then
6952 rmfiles="$rmfiles $objdir/lt-$name"
6954 if test "X$noexename" != "X$name" ; then
6955 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6961 $show "$rm $rmfiles"
6962 $run $rm $rmfiles || exit_status=1
6964 objdir="$origobjdir"
6966 # Try to remove the ${objdir}s in the directories where we deleted files
6967 for dir in $rmdirs; do
6968 if test -d "$dir"; then
6970 $run rmdir $dir >/dev/null 2>&1
6978 $echo "$modename: you must specify a MODE" 1>&2
6979 $echo "$generic_help" 1>&2
6984 if test -z "$exec_cmd"; then
6985 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6986 $echo "$generic_help" 1>&2
6989 fi # test -z "$show_help"
6991 if test -n "$exec_cmd"; then
6996 # We need to display help for each of the modes.
6999 "Usage: $modename [OPTION]... [MODE-ARG]...
7001 Provide generalized library-building support services.
7003 --config show all configuration variables
7004 --debug enable verbose shell tracing
7005 -n, --dry-run display commands without modifying any files
7006 --features display basic configuration information and exit
7007 --finish same as \`--mode=finish'
7008 --help display this help message and exit
7009 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
7010 --quiet same as \`--silent'
7011 --silent don't print informational messages
7012 --tag=TAG use configuration variables from tag TAG
7013 --version print version information
7015 MODE must be one of the following:
7017 clean remove files from the build directory
7018 compile compile a source file into a libtool object
7019 execute automatically set library path, then run a program
7020 finish complete the installation of libtool libraries
7021 install install libraries or executables
7022 link create a library or an executable
7023 uninstall remove libraries from an installed directory
7025 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
7026 a more detailed description of MODE.
7028 Report bugs to <bug-libtool@gnu.org>."
7034 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
7036 Remove files from the build directory.
7038 RM is the name of the program to use to delete files associated with each FILE
7039 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
7042 If FILE is a libtool library, object or program, all the files associated
7043 with it are deleted. Otherwise, only FILE itself is deleted using RM."
7048 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
7050 Compile a source file into a libtool library object.
7052 This mode accepts the following additional options:
7054 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
7055 -prefer-pic try to building PIC objects only
7056 -prefer-non-pic try to building non-PIC objects only
7057 -static always build a \`.o' file suitable for static linking
7059 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
7060 from the given SOURCEFILE.
7062 The output file name is determined by removing the directory component from
7063 SOURCEFILE, then substituting the C source code suffix \`.c' with the
7064 library object suffix, \`.lo'."
7069 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
7071 Automatically set library path, then run a program.
7073 This mode accepts the following additional options:
7075 -dlopen FILE add the directory containing FILE to the library path
7077 This mode sets the library path environment variable according to \`-dlopen'
7080 If any of the ARGS are libtool executable wrappers, then they are translated
7081 into their corresponding uninstalled binary, and any of their required library
7082 directories are added to the library path.
7084 Then, COMMAND is executed, with ARGS as arguments."
7089 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
7091 Complete the installation of libtool libraries.
7093 Each LIBDIR is a directory that contains libtool libraries.
7095 The commands that this mode executes may require superuser privileges. Use
7096 the \`--dry-run' option if you just want to see what would be executed."
7101 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
7103 Install executables or libraries.
7105 INSTALL-COMMAND is the installation command. The first component should be
7106 either the \`install' or \`cp' program.
7108 The rest of the components are interpreted as arguments to that command (only
7109 BSD-compatible install options are recognized)."
7114 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
7116 Link object files or libraries together to form another library, or to
7117 create an executable program.
7119 LINK-COMMAND is a command using the C compiler that you would use to create
7120 a program from several object files.
7122 The following components of LINK-COMMAND are treated specially:
7124 -all-static do not do any dynamic linking at all
7125 -avoid-version do not add a version suffix if possible
7126 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
7127 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
7128 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
7129 -export-symbols SYMFILE
7130 try to export only the symbols listed in SYMFILE
7131 -export-symbols-regex REGEX
7132 try to export only the symbols matching REGEX
7133 -LLIBDIR search LIBDIR for required installed libraries
7134 -lNAME OUTPUT-FILE requires the installed library libNAME
7135 -module build a library that can dlopened
7136 -no-fast-install disable the fast-install mode
7137 -no-install link a not-installable executable
7138 -no-undefined declare that a library does not refer to external symbols
7139 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
7140 -objectlist FILE Use a list of object files found in FILE to specify objects
7141 -precious-files-regex REGEX
7142 don't remove output files matching REGEX
7143 -release RELEASE specify package release information
7144 -rpath LIBDIR the created library will eventually be installed in LIBDIR
7145 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
7146 -static do not do any dynamic linking of libtool libraries
7147 -version-info CURRENT[:REVISION[:AGE]]
7148 specify library version info [each variable defaults to 0]
7150 All other options (arguments beginning with \`-') are ignored.
7152 Every other argument is treated as a filename. Files ending in \`.la' are
7153 treated as uninstalled libtool libraries, other files are standard or library
7156 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
7157 only library objects (\`.lo' files) may be specified, and \`-rpath' is
7158 required, except when creating a convenience library.
7160 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
7161 using \`ar' and \`ranlib', or on Windows using \`lib'.
7163 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
7164 is created, otherwise an executable program is created."
7169 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
7171 Remove libraries from an installation directory.
7173 RM is the name of the program to use to delete files associated with each FILE
7174 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
7177 If FILE is a libtool library, all the files associated with it are deleted.
7178 Otherwise, only FILE itself is deleted using RM."
7182 $echo "$modename: invalid operation mode \`$mode'" 1>&2
7189 $echo "Try \`$modename --help' for more information about other modes."
7193 # The TAGs below are defined such that we never get into a situation
7194 # in which we disable both kinds of libraries. Given conflicting
7195 # choices, we go for a static library, that is the most portable,
7196 # since we can't tell whether shared libraries were disabled because
7197 # the user asked for that or because the platform doesn't support
7198 # them. This is particularly important on AIX, because we don't
7199 # support having both static and shared libraries enabled at the same
7200 # time on that platform, so we default to a shared-only configuration.
7201 # If a disable-shared tag is given, we'll fallback to a static-only
7202 # configuration. But we'll never go from static-only to shared-only.
7204 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
7206 # ### END LIBTOOL TAG CONFIG: disable-shared
7208 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
7210 # ### END LIBTOOL TAG CONFIG: disable-static
7216 # ### BEGIN LIBTOOL TAG CONFIG: CXX
7218 # Libtool was configured on host hazel:
7220 # Shell to use when invoking shell scripts.
7223 # Whether or not to build shared libraries.
7224 build_libtool_libs=yes
7226 # Whether or not to build static libraries.
7229 # Whether or not to add -lc for building shared libraries.
7230 build_libtool_need_lc=no
7232 # Whether or not to disallow shared libs when runtime libs are static
7233 allow_libtool_libs_with_static_runtimes=no
7235 # Whether or not to optimize for fast installation.
7240 host=i686-pc-linux-gnu
7245 build=i686-pc-linux-gnu
7248 # An echo program that does not interpret backslashes.
7258 # LTCC compiler flags.
7261 # A language-specific compiler.
7264 # Is the compiler the GNU C compiler?
7270 # The linker used to build libraries.
7273 # Whether we need hard or soft links.
7276 # A BSD-compatible nm program.
7279 # A symbol stripping program
7282 # Used to examine libraries when file_magic_cmd begins "file"
7285 # Used on cygwin: DLL creation program.
7288 # Used on cygwin: object dumper.
7291 # Used on cygwin: assembler.
7294 # The name of the directory that contains temporary libtool files.
7297 # How to create reloadable object files.
7299 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
7301 # How to pass a linker flag through the compiler.
7304 # Object file suffix (normally "o").
7307 # Old archive suffix (normally "a").
7310 # Shared library suffix (normally ".so").
7313 # Executable file suffix (normally "").
7316 # Additional compiler flags for building library objects.
7317 pic_flag=" -fPIC -DPIC"
7320 # What is the maximum length of a command?
7323 # Does compiler simultaneously support -c and -o options?
7326 # Must we lock files when doing compilation?
7329 # Do we need the lib prefix for modules?
7332 # Do we need a version for libraries?
7335 # Whether dlopen is supported.
7336 dlopen_support=unknown
7338 # Whether dlopen of programs is supported.
7341 # Whether dlopen of statically linked programs is supported.
7342 dlopen_self_static=unknown
7344 # Compiler flag to prevent dynamic linking.
7345 link_static_flag="-static"
7347 # Compiler flag to turn off builtin functions.
7348 no_builtin_flag=" -fno-builtin"
7350 # Compiler flag to allow reflexive dlopens.
7351 export_dynamic_flag_spec="\${wl}--export-dynamic"
7353 # Compiler flag to generate shared objects directly from archives.
7354 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
7356 # Compiler flag to generate thread-safe objects.
7357 thread_safe_flag_spec=""
7359 # Library versioning type.
7362 # Format of library name prefix.
7363 libname_spec="lib\$name"
7365 # List of archive names. First name is the real one, the rest are links.
7366 # The last name is the one that the linker finds with -lNAME.
7367 library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
7369 # The coded name of the library, if different from the real name.
7370 soname_spec="\${libname}\${release}\${shared_ext}\$major"
7372 # Commands used to build and install an old-style archive.
7374 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
7375 old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
7376 old_postuninstall_cmds=""
7378 # Create an old-style archive from a shared archive.
7379 old_archive_from_new_cmds=""
7381 # Create a temporary old-style archive to link instead of a shared archive.
7382 old_archive_from_expsyms_cmds=""
7384 # Commands used to build and install a shared archive.
7385 archive_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
7386 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"
7388 postuninstall_cmds=""
7390 # Commands used to build a loadable module (assumed same as above if empty)
7392 module_expsym_cmds=""
7394 # Commands to strip libraries.
7395 old_striplib="strip --strip-debug"
7396 striplib="strip --strip-unneeded"
7398 # Dependencies to place before the objects being linked to create a
7400 predep_objects="/usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib/crti.o /usr/lib/gcc/i486-linux-gnu/4.3.2/crtbeginS.o"
7402 # Dependencies to place after the objects being linked to create a
7404 postdep_objects="/usr/lib/gcc/i486-linux-gnu/4.3.2/crtendS.o /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib/crtn.o"
7406 # Dependencies to place before the objects being linked to create a
7410 # Dependencies to place after the objects being linked to create a
7412 postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
7414 # The library search path used internally by the compiler when linking
7416 compiler_lib_search_path="-L/usr/lib/gcc/i486-linux-gnu/4.3.2 -L/usr/lib/gcc/i486-linux-gnu/4.3.2 -L/usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/i486-linux-gnu/4.3.2/../../.."
7418 # Method to check whether dependent libraries are shared objects.
7419 deplibs_check_method="pass_all"
7421 # Command to use when deplibs_check_method == file_magic.
7422 file_magic_cmd="\$MAGIC_CMD"
7424 # Flag that allows shared libraries with undefined symbols to be built.
7425 allow_undefined_flag=""
7427 # Flag that forces no undefined symbols.
7428 no_undefined_flag=""
7430 # Commands used to finish a libtool library installation in a directory.
7431 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
7433 # Same as above, but a single script fragment to be evaled but not shown.
7436 # Take the output of nm and produce a listing of raw symbols and C names.
7437 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
7439 # Transform the output of nm in a proper C declaration
7440 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
7442 # Transform the output of nm in a C name address pair
7443 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
7445 # This is the shared library runtime path variable.
7446 runpath_var=LD_RUN_PATH
7448 # This is the shared library path variable.
7449 shlibpath_var=LD_LIBRARY_PATH
7451 # Is shlibpath searched before the hard-coded library search path?
7452 shlibpath_overrides_runpath=no
7454 # How to hardcode a shared library path into an executable.
7455 hardcode_action=immediate
7457 # Whether we should hardcode library paths into libraries.
7458 hardcode_into_libs=yes
7460 # Flag to hardcode $libdir into a binary during linking.
7461 # This must work even if $libdir does not exist.
7462 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
7464 # If ld is used when linking, flag to hardcode $libdir into
7465 # a binary during linking. This must work even if $libdir does
7467 hardcode_libdir_flag_spec_ld=""
7469 # Whether we need a single -rpath flag with a separated argument.
7470 hardcode_libdir_separator=""
7472 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
7476 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
7480 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
7481 # the resulting binary.
7482 hardcode_shlibpath_var=unsupported
7484 # Set to yes if building a shared library automatically hardcodes DIR into the library
7485 # and all subsequent libraries and executables linked against it.
7486 hardcode_automatic=no
7488 # Variables whose values should be saved in libtool wrapper scripts and
7489 # restored at relink time.
7490 variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
7492 # Whether libtool must link a program against all its dependency libraries.
7493 link_all_deplibs=unknown
7495 # Compile-time system search path for libraries
7496 sys_lib_search_path_spec=" /usr/lib/gcc/i486-linux-gnu/4.3.2/ /usr/lib/gcc/i486-linux-gnu/4.3.2/ /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../i486-linux-gnu/lib/i486-linux-gnu/4.3.2/ /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../i486-linux-gnu/lib/../lib/ /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../i486-linux-gnu/4.3.2/ /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib/ /lib/i486-linux-gnu/4.3.2/ /lib/../lib/ /usr/lib/i486-linux-gnu/4.3.2/ /usr/lib/../lib/ /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../i486-linux-gnu/lib/ /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../ /lib/ /usr/lib/"
7498 # Run-time system search path for libraries
7499 sys_lib_dlsearch_path_spec="/lib /usr/lib /lib/i486-linux-gnu /usr/lib/i486-linux-gnu /usr/local/lib "
7501 # Fix the shell variable $srcfile for the compiler.
7504 # Set to yes if exported symbols are required.
7505 always_export_symbols=no
7507 # The commands to list exported symbols.
7508 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
7510 # The commands to extract the exported symbol list from a shared archive.
7511 extract_expsyms_cmds=""
7513 # Symbols that should not be listed in the preloaded symbols.
7516 # Symbols that must always be exported.
7519 # ### END LIBTOOL TAG CONFIG: CXX