3 # libtoolT - Provide generalized library-building support services.
4 # Generated automatically by (GNU yandex-fotki-sharing-plugin 0.1)
5 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
7 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
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.
33 SED="/scratchbox/tools/bin/sed"
35 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
36 Xsed="/scratchbox/tools/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 hitobook:
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=arm-unknown-linux-gnu
74 build=arm-unknown-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?
97 EGREP="/scratchbox/tools/bin/grep -E"
99 # The linker used to build libraries.
100 LD="/scratchbox/compilers/cs2007q3-glibc2.5-arm7/arm-none-linux-gnueabi/bin/ld"
102 # Whether we need hard or soft links.
105 # A BSD-compatible nm program.
106 NM="/scratchbox/compilers/bin/nm -B"
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~\$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 directories searched by this compiler when creating a shared
248 compiler_lib_search_dirs=""
250 # The library search path used internally by the compiler when linking
252 compiler_lib_search_path=""
254 # Method to check whether dependent libraries are shared objects.
255 deplibs_check_method="pass_all"
257 # Command to use when deplibs_check_method == file_magic.
258 file_magic_cmd="\$MAGIC_CMD"
260 # Flag that allows shared libraries with undefined symbols to be built.
261 allow_undefined_flag=""
263 # Flag that forces no undefined symbols.
266 # Commands used to finish a libtool library installation in a directory.
267 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
269 # Same as above, but a single script fragment to be evaled but not shown.
272 # Take the output of nm and produce a listing of raw symbols and C names.
273 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
275 # Transform the output of nm in a proper C declaration
276 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
278 # Transform the output of nm in a C name address pair
279 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
281 # This is the shared library runtime path variable.
282 runpath_var=LD_RUN_PATH
284 # This is the shared library path variable.
285 shlibpath_var=LD_LIBRARY_PATH
287 # Is shlibpath searched before the hard-coded library search path?
288 shlibpath_overrides_runpath=no
290 # How to hardcode a shared library path into an executable.
291 hardcode_action=immediate
293 # Whether we should hardcode library paths into libraries.
294 hardcode_into_libs=yes
296 # Flag to hardcode $libdir into a binary during linking.
297 # This must work even if $libdir does not exist.
298 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
300 # If ld is used when linking, flag to hardcode $libdir into
301 # a binary during linking. This must work even if $libdir does
303 hardcode_libdir_flag_spec_ld=""
305 # Whether we need a single -rpath flag with a separated argument.
306 hardcode_libdir_separator=""
308 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
312 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
316 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
317 # the resulting binary.
318 hardcode_shlibpath_var=unsupported
320 # Set to yes if building a shared library automatically hardcodes DIR into the library
321 # and all subsequent libraries and executables linked against it.
322 hardcode_automatic=no
324 # Variables whose values should be saved in libtool wrapper scripts and
325 # restored at relink time.
326 variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
328 # Whether libtool must link a program against all its dependency libraries.
329 link_all_deplibs=unknown
331 # Compile-time system search path for libraries
332 sys_lib_search_path_spec="/scratchbox/compilers/cs2007q3-glibc2.5-arm7/lib/gcc/arm-none-linux-gnueabi/4.2.1 /scratchbox/compilers/cs2007q3-glibc2.5-arm7/lib/gcc /scratchbox/compilers/cs2007q3-glibc2.5-arm7/arm-none-linux-gnueabi/lib /scratchbox/compilers/cs2007q3-glibc2.5-arm7/arm-none-linux-gnueabi/libc/lib /scratchbox/compilers/cs2007q3-glibc2.5-arm7/arm-none-linux-gnueabi/libc/usr/lib"
334 # Run-time system search path for libraries
335 sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/local/lib /usr/lib /lib /usr/lib/microb-engine /usr/lib/microb-engine/components "
337 # Fix the shell variable $srcfile for the compiler.
340 # Set to yes if exported symbols are required.
341 always_export_symbols=no
343 # The commands to list exported symbols.
344 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
346 # The commands to extract the exported symbol list from a shared archive.
347 extract_expsyms_cmds=""
349 # Symbols that should not be listed in the preloaded symbols.
350 exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
352 # Symbols that must always be exported.
355 # ### END LIBTOOL CONFIG
357 # ltmain.sh - Provide generalized library-building support services.
358 # NOTE: Changing this file will not affect anything until you rerun configure.
360 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
361 # 2007, 2008 Free Software Foundation, Inc.
362 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
364 # This program is free software; you can redistribute it and/or modify
365 # it under the terms of the GNU General Public License as published by
366 # the Free Software Foundation; either version 2 of the License, or
367 # (at your option) any later version.
369 # This program is distributed in the hope that it will be useful, but
370 # WITHOUT ANY WARRANTY; without even the implied warranty of
371 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
372 # General Public License for more details.
374 # You should have received a copy of the GNU General Public License
375 # along with this program; if not, write to the Free Software
376 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
378 # As a special exception to the GNU General Public License, if you
379 # distribute this file as part of a program that contains a
380 # configuration script generated by Autoconf, you may include it under
381 # the same distribution terms that you use for the rest of that program.
385 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
386 # is ksh but when the shell is invoked as "sh" and the current value of
387 # the _XPG environment variable is not equal to 1 (one), the special
388 # positional parameter $0, within a function call, is the name of the
392 # The name of this program:
393 progname=`echo "$progpath" | $SED $basename`
403 TIMESTAMP=" (1.1220.2.492 2008/01/30 06:40:56)"
405 # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
406 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
409 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
410 # is contrary to our usage. Disable this feature.
411 alias -g '${1+"$@"}'='"$@"'
414 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
416 BIN_SH=xpg4; export BIN_SH # for Tru64
417 DUALCASE=1; export DUALCASE # for MKS sh
419 # Check that we have a working $echo.
420 if test "X$1" = X--no-reexec; then
421 # Discard the --no-reexec flag, and continue.
423 elif test "X$1" = X--fallback-echo; then
424 # Avoid inline document here, it may be left over
426 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
427 # Yippee, $echo works!
430 # Restart under the correct shell, and then maybe $echo will work.
431 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
434 if test "X$1" = X--fallback-echo; then
435 # used as fallback echo
444 help="Try \`$progname --help' for more information."
445 magic="%%%MAGIC variable%%%"
450 # Sed substitution that helps us do robust quoting. It backslashifies
451 # metacharacters that are still active within double-quoted strings.
452 Xsed="${SED}"' -e 1s/^X//'
453 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
454 # test EBCDIC or ASCII
455 case `echo X|tr X '\101'` in
456 A) # ASCII based system
457 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
459 NL2SP='tr \015\012 \040\040'
461 *) # EBCDIC based system
463 NL2SP='tr \r\n \100\100'
468 # Only set LANG and LC_ALL to C if already set.
469 # These must not be set unconditionally because not all systems understand
470 # e.g. LANG=C (notably SCO).
471 # We save the old values to restore during execute mode.
473 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
475 eval "if test \"\${$lt_var+set}\" = set; then
476 save_$lt_var=\$$lt_var
477 lt_env=\"$lt_var=\$$lt_var \$lt_env\"
483 if test -n "$lt_env"; then
487 # Make sure IFS has a sensible default
492 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
493 $echo "$modename: not configured to build any kind of library" 1>&2
494 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
509 lo2o="s/\\.lo\$/.${objext}/"
510 o2lo="s/\\.${objext}\$/.lo/"
514 #####################################
515 # Shell function definitions:
516 # This seems to be the best place for them
518 # func_mktempdir [string]
519 # Make a temporary directory that won't clash with other running
520 # libtool processes, and avoids race conditions if possible. If
521 # given, STRING is the basename for that directory.
524 my_template="${TMPDIR-/tmp}/${1-$progname}"
526 if test "$run" = ":"; then
527 # Return a directory name, but don't create it in dry-run mode
528 my_tmpdir="${my_template}-$$"
531 # If mktemp works, use that first and foremost
532 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
534 if test ! -d "$my_tmpdir"; then
535 # Failing that, at least try and use $RANDOM to avoid a race
536 my_tmpdir="${my_template}-${RANDOM-0}$$"
538 save_mktempdir_umask=`umask`
541 umask $save_mktempdir_umask
544 # If we're not in dry-run mode, bomb out on failure
545 test -d "$my_tmpdir" || {
546 $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
551 $echo "X$my_tmpdir" | $Xsed
555 # func_win32_libid arg
556 # return the library type of file 'arg'
558 # Need a lot of goo to handle *both* DLLs and import libs
559 # Has to be a shell function in order to 'eat' the argument
560 # that is supplied when $file_magic_command is called.
563 win32_libid_type="unknown"
564 win32_fileres=`file -L $1 2>/dev/null`
565 case $win32_fileres in
566 *ar\ archive\ import\ library*) # definitely import
567 win32_libid_type="x86 archive import"
569 *ar\ archive*) # could be an import, or static
570 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
571 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
572 win32_nmres=`eval $NM -f posix -A $1 | \
581 import*) win32_libid_type="x86 archive import";;
582 *) win32_libid_type="x86 archive static";;
587 win32_libid_type="x86 DLL"
589 *executable*) # but shell scripts are "executable" too...
590 case $win32_fileres in
591 *MS\ Windows\ PE\ Intel*)
592 win32_libid_type="x86 DLL"
597 $echo $win32_libid_type
602 # Infer tagged configuration to use if any are available and
603 # if one wasn't chosen via the "--tag" command line option.
604 # Only attempt this if the compiler in the base compile
605 # command doesn't match the default compiler.
606 # arg is usually of the form 'gcc ...'
609 if test -n "$available_tags" && test -z "$tagname"; then
613 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
617 CC_quoted="$CC_quoted $arg"
620 # Blanks in the command may have been stripped by the calling shell,
621 # but not from the CC environment variable when configure was run.
622 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
623 # Blanks at the start of $base_compile will cause this to fail
624 # if we don't check for them as well.
626 for z in $available_tags; do
627 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
628 # Evaluate the configuration.
629 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
632 # Double-quote args containing other shell metacharacters.
634 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
638 CC_quoted="$CC_quoted $arg"
641 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
642 # The compiler in the base compile command matches
643 # the one in the tagged configuration.
644 # Assume this is the tagged configuration we want.
651 # If $tagname still isn't set, then no tagged configuration
652 # was found and let the user know that the "--tag" command
653 # line option must be used.
654 if test -z "$tagname"; then
655 $echo "$modename: unable to infer tagged configuration"
656 $echo "$modename: specify a tag with \`--tag'" 1>&2
659 # $echo "$modename: using $tagname tagged configuration"
667 # func_extract_an_archive dir oldlib
668 func_extract_an_archive ()
670 f_ex_an_ar_dir="$1"; shift
671 f_ex_an_ar_oldlib="$1"
673 $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
674 $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
675 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
678 $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
683 # func_extract_archives gentop oldlib ...
684 func_extract_archives ()
686 my_gentop="$1"; shift
694 $show "${rm}r $my_gentop"
695 $run ${rm}r "$my_gentop"
696 $show "$mkdir $my_gentop"
697 $run $mkdir "$my_gentop"
699 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
703 for my_xlib in $my_oldlibs; do
704 # Extract the objects.
706 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
707 *) my_xabs=`pwd`"/$my_xlib" ;;
709 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
712 case " $extracted_archives " in
714 extracted_serial=`expr $extracted_serial + 1`
715 my_xlib_u=lt$extracted_serial-$my_xlib ;;
719 extracted_archives="$extracted_archives $my_xlib_u"
720 my_xdir="$my_gentop/$my_xlib_u"
722 $show "${rm}r $my_xdir"
723 $run ${rm}r "$my_xdir"
724 $show "$mkdir $my_xdir"
725 $run $mkdir "$my_xdir"
727 if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
732 $show "Extracting $my_xabs"
733 # Do not bother doing anything if just a dry run
734 if test -z "$run"; then
735 darwin_orig_dir=`pwd`
736 cd $my_xdir || exit $?
737 darwin_archive=$my_xabs
739 darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
740 darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
741 if test -n "$darwin_arches"; then
742 darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
744 $show "$darwin_base_archive has multiple architectures $darwin_arches"
745 for darwin_arch in $darwin_arches ; do
746 mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
747 lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
748 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
749 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
751 $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
752 done # $darwin_arches
753 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
754 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
757 for darwin_file in $darwin_filelist; do
758 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
759 lipo -create -output "$darwin_file" $darwin_files
760 done # $darwin_filelist
762 cd "$darwin_orig_dir"
764 cd "$darwin_orig_dir"
765 func_extract_an_archive "$my_xdir" "$my_xabs"
770 func_extract_an_archive "$my_xdir" "$my_xabs"
773 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
775 func_extract_archives_result="$my_oldobjs"
777 # End of Shell function definitions
778 #####################################
781 eval std_shrext=\"$shrext_cmds\"
785 # Parse our command line options once, thoroughly.
786 while test "$#" -gt 0
792 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
796 # If the previous option needs an argument, assign it.
797 if test -n "$prev"; then
800 execute_dlfiles="$execute_dlfiles $arg"
804 preserve_args="${preserve_args}=$arg"
806 # Check whether tagname contains only valid characters
809 $echo "$progname: invalid tag name: $tagname" 1>&2
816 # Don't test for the "default" C tag, as we know, it's there, but
817 # not specially marked.
820 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
821 taglist="$taglist $tagname"
822 # Evaluate the configuration.
823 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
825 $echo "$progname: ignoring unknown tag $tagname" 1>&2
840 # Have we seen a non-optional argument yet?
848 $PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP
850 Copyright (C) 2008 Free Software Foundation, Inc.
851 This is free software; see the source for copying conditions. There is NO
852 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
857 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
858 # Now print the configurations for the tags.
859 for tagname in $taglist; do
860 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
866 $echo "$progname: enabling shell trace mode"
868 preserve_args="$preserve_args $arg"
877 if test "$build_libtool_libs" = yes; then
878 $echo "enable shared libraries"
880 $echo "disable shared libraries"
882 if test "$build_old_libs" = yes; then
883 $echo "enable static libraries"
885 $echo "disable static libraries"
890 --finish) mode="finish" ;;
892 --mode) prevopt="--mode" prev=mode ;;
893 --mode=*) mode="$optarg" ;;
895 --preserve-dup-deps) duplicate_deps="yes" ;;
899 preserve_args="$preserve_args $arg"
905 preserve_args="$preserve_args --tag"
908 set tag "$optarg" ${1+"$@"}
911 preserve_args="$preserve_args --tag"
920 $echo "$modename: unrecognized option \`$arg'" 1>&2
932 if test -n "$prevopt"; then
933 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
938 case $disable_libs in
942 build_libtool_libs=no
946 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
950 # If this variable is set in any of the actions, the command in it
951 # will be execed at the end. This prevents here-documents from being
952 # left over by shells.
955 if test -z "$show_help"; then
957 # Infer the operation mode.
958 if test -z "$mode"; then
959 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
960 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
962 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
974 *db | *dbx | *strace | *truss)
984 # If we have no mode, but dlfiles were specified, then do execute mode.
985 test -n "$execute_dlfiles" && mode=execute
987 # Just use the default operation mode.
988 if test -z "$mode"; then
989 if test -n "$nonopt"; then
990 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
992 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
999 # Only execute mode is allowed to have -dlopen flags.
1000 if test -n "$execute_dlfiles" && test "$mode" != execute; then
1001 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
1006 # Change the help message to a mode-specific one.
1007 generic_help="$help"
1008 help="Try \`$modename --help --mode=$mode' for more information."
1010 # These modes are in order of execution frequency so that they run quickly.
1012 # libtool compile mode
1014 modename="$modename: compile"
1015 # Get the compilation command and the source file.
1017 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
1028 # do not "continue". Instead, add this to base_compile
1040 # Accept any command-line options.
1043 if test -n "$libobj" ; then
1044 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
1051 -static | -prefer-pic | -prefer-non-pic)
1062 arg_mode=arg # the next one goes into the "base_compile" arg list
1063 continue # The current "srcfile" will either be retained or
1064 ;; # replaced later. I would guess that would be a bug.
1067 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
1069 save_ifs="$IFS"; IFS=','
1070 for arg in $args; do
1073 # Double-quote args containing other shell metacharacters.
1074 # Many Bourne shells cannot handle close brackets correctly
1075 # in scan sets, so we specify it separately.
1077 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1081 lastarg="$lastarg $arg"
1084 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
1086 # Add the arguments to base_compile.
1087 base_compile="$base_compile $lastarg"
1092 # Accept the current argument as the source file.
1093 # The previous "srcfile" becomes the current argument.
1100 esac # case $arg_mode
1102 # Aesthetically quote the previous argument.
1103 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
1106 # Double-quote args containing other shell metacharacters.
1107 # Many Bourne shells cannot handle close brackets correctly
1108 # in scan sets, and some SunOS ksh mistreat backslash-escaping
1109 # in scan sets (worked around with variable expansion),
1110 # and furthermore cannot handle '|' '&' '(' ')' in scan sets
1111 # at all, so we specify them separately.
1112 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1113 lastarg="\"$lastarg\""
1117 base_compile="$base_compile $lastarg"
1122 $echo "$modename: you must specify an argument for -Xcompile"
1126 $echo "$modename: you must specify a target with \`-o'" 1>&2
1130 # Get the name of the library object.
1131 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
1135 # Recognize several different file suffixes.
1136 # If the user specifies -o file.o, it is replaced with file.lo
1146 *.class) xform=class ;;
1149 *.[fF][09]?) xform=[fF][09]. ;;
1151 *.java) xform=java ;;
1156 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
1159 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
1161 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
1166 func_infer_tag $base_compile
1168 for arg in $later; do
1187 qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
1189 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1190 qlibobj="\"$qlibobj\"" ;;
1192 test "X$libobj" != "X$qlibobj" \
1193 && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
1194 && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
1195 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
1196 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
1197 if test "X$xdir" = "X$obj"; then
1202 lobj=${xdir}$objdir/$objname
1204 if test -z "$base_compile"; then
1205 $echo "$modename: you must specify a compilation command" 1>&2
1210 # Delete any leftover library objects.
1211 if test "$build_old_libs" = yes; then
1212 removelist="$obj $lobj $libobj ${libobj}T"
1214 removelist="$lobj $libobj ${libobj}T"
1217 $run $rm $removelist
1218 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1220 # On Cygwin there's no "real" PIC flag so we must build both object types
1222 cygwin* | mingw* | pw32* | os2*)
1226 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
1227 # non-PIC code in shared libraries is not supported
1231 # Calculate the filename of the output object if compiler does
1232 # not support -o with -c
1233 if test "$compiler_c_o" = no; then
1234 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
1235 lockfile="$output_obj.lock"
1236 removelist="$removelist $output_obj $lockfile"
1237 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1244 # Lock this critical section if it is needed
1245 # We use this script file to make the link, it avoids creating a new file
1246 if test "$need_locks" = yes; then
1247 until $run ln "$progpath" "$lockfile" 2>/dev/null; do
1248 $show "Waiting for $lockfile to be removed"
1251 elif test "$need_locks" = warn; then
1252 if test -f "$lockfile"; then
1254 *** ERROR, $lockfile exists and contains:
1255 `cat $lockfile 2>/dev/null`
1257 This indicates that another process is trying to use the same
1258 temporary object file, and libtool could not work around it because
1259 your compiler does not support \`-c' and \`-o' together. If you
1260 repeat this compilation, it may succeed, by chance, but you had better
1261 avoid parallel builds (make -j) in this platform, or get a better
1264 $run $rm $removelist
1267 $echo "$srcfile" > "$lockfile"
1270 if test -n "$fix_srcfile_path"; then
1271 eval srcfile=\"$fix_srcfile_path\"
1273 qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
1275 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1276 qsrcfile="\"$qsrcfile\"" ;;
1279 $run $rm "$libobj" "${libobj}T"
1281 # Create a libtool object file (analogous to a ".la" file),
1282 # but don't create it if we're doing a dry run.
1283 test -z "$run" && cat > ${libobj}T <<EOF
1284 # $libobj - a libtool object file
1285 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
1287 # Please DO NOT delete this file!
1288 # It is necessary for linking the library.
1290 # Name of the PIC object.
1293 # Only build a PIC object if we are building libtool libraries.
1294 if test "$build_libtool_libs" = yes; then
1295 # Without this assignment, base_compile gets emptied.
1296 fbsd_hideous_sh_bug=$base_compile
1298 if test "$pic_mode" != no; then
1299 command="$base_compile $qsrcfile $pic_flag"
1301 # Don't build PIC code
1302 command="$base_compile $qsrcfile"
1305 if test ! -d "${xdir}$objdir"; then
1306 $show "$mkdir ${xdir}$objdir"
1307 $run $mkdir ${xdir}$objdir
1309 if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
1314 if test -z "$output_obj"; then
1315 # Place PIC objects in $objdir
1316 command="$command -o $lobj"
1319 $run $rm "$lobj" "$output_obj"
1322 if $run eval $lt_env "$command"; then :
1324 test -n "$output_obj" && $run $rm $removelist
1328 if test "$need_locks" = warn &&
1329 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1331 *** ERROR, $lockfile contains:
1332 `cat $lockfile 2>/dev/null`
1334 but it should contain:
1337 This indicates that another process is trying to use the same
1338 temporary object file, and libtool could not work around it because
1339 your compiler does not support \`-c' and \`-o' together. If you
1340 repeat this compilation, it may succeed, by chance, but you had better
1341 avoid parallel builds (make -j) in this platform, or get a better
1344 $run $rm $removelist
1348 # Just move the object if needed, then go on to compile the next one
1349 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1350 $show "$mv $output_obj $lobj"
1351 if $run $mv $output_obj $lobj; then :
1354 $run $rm $removelist
1359 # Append the name of the PIC object to the libtool object file.
1360 test -z "$run" && cat >> ${libobj}T <<EOF
1361 pic_object='$objdir/$objname'
1365 # Allow error messages only from the first compilation.
1366 if test "$suppress_opt" = yes; then
1367 suppress_output=' >/dev/null 2>&1'
1370 # No PIC object so indicate it doesn't exist in the libtool
1372 test -z "$run" && cat >> ${libobj}T <<EOF
1378 # Only build a position-dependent object if we build old libraries.
1379 if test "$build_old_libs" = yes; then
1380 if test "$pic_mode" != yes; then
1381 # Don't build PIC code
1382 command="$base_compile $qsrcfile"
1384 command="$base_compile $qsrcfile $pic_flag"
1386 if test "$compiler_c_o" = yes; then
1387 command="$command -o $obj"
1390 # Suppress compiler output if we already did a PIC compilation.
1391 command="$command$suppress_output"
1392 $run $rm "$obj" "$output_obj"
1394 if $run eval $lt_env "$command"; then :
1396 $run $rm $removelist
1400 if test "$need_locks" = warn &&
1401 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1403 *** ERROR, $lockfile contains:
1404 `cat $lockfile 2>/dev/null`
1406 but it should contain:
1409 This indicates that another process is trying to use the same
1410 temporary object file, and libtool could not work around it because
1411 your compiler does not support \`-c' and \`-o' together. If you
1412 repeat this compilation, it may succeed, by chance, but you had better
1413 avoid parallel builds (make -j) in this platform, or get a better
1416 $run $rm $removelist
1420 # Just move the object if needed
1421 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1422 $show "$mv $output_obj $obj"
1423 if $run $mv $output_obj $obj; then :
1426 $run $rm $removelist
1431 # Append the name of the non-PIC object the libtool object file.
1432 # Only append if the libtool object file exists.
1433 test -z "$run" && cat >> ${libobj}T <<EOF
1434 # Name of the non-PIC object.
1435 non_pic_object='$objname'
1439 # Append the name of the non-PIC object the libtool object file.
1440 # Only append if the libtool object file exists.
1441 test -z "$run" && cat >> ${libobj}T <<EOF
1442 # Name of the non-PIC object.
1448 $run $mv "${libobj}T" "${libobj}"
1450 # Unlock the critical section if it was locked
1451 if test "$need_locks" != no; then
1452 $run $rm "$lockfile"
1460 modename="$modename: link"
1462 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1463 # It is impossible to link a dll without this setting, and
1464 # we shouldn't force the makefile maintainer to figure out
1465 # which system we are compiling for in order to pass an extra
1466 # flag for every libtool invocation.
1467 # allow_undefined=no
1469 # FIXME: Unfortunately, there are problems with the above when trying
1470 # to make a dll which has undefined symbols, in which case not
1471 # even a static library is built. For now, we need to specify
1472 # -no-undefined on the libtool link line when we can be certain
1473 # that all symbols are satisfied, otherwise we get a static library.
1480 libtool_args="$nonopt"
1481 base_compile="$nonopt $@"
1482 compile_command="$nonopt"
1483 finalize_command="$nonopt"
1496 lib_search_path=`pwd`
1505 export_symbols_regex=
1513 notinst_path= # paths that contain not-installed libtool libraries
1514 precious_files_regex=
1515 prefer_static_libs=no
1527 single_module="${wl}-single_module"
1529 func_infer_tag $base_compile
1531 # We need to know -static, to get the right output filenames.
1535 -all-static | -static | -static-libtool-libs)
1538 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1539 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1541 if test -n "$link_static_flag"; then
1542 dlopen_self=$dlopen_self_static
1544 prefer_static_libs=yes
1547 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1548 dlopen_self=$dlopen_self_static
1550 prefer_static_libs=built
1552 -static-libtool-libs)
1553 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1554 dlopen_self=$dlopen_self_static
1556 prefer_static_libs=yes
1559 build_libtool_libs=no
1566 # See if our shared archives depend on static archives.
1567 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1569 # Go through the arguments, transforming them on the way.
1570 while test "$#" -gt 0; do
1574 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1575 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1579 libtool_args="$libtool_args $qarg"
1581 # If the previous option needs an argument, assign it.
1582 if test -n "$prev"; then
1585 compile_command="$compile_command @OUTPUT@"
1586 finalize_command="$finalize_command @OUTPUT@"
1592 if test "$preload" = no; then
1593 # Add the symbol object into the linking commands.
1594 compile_command="$compile_command @SYMFILE@"
1595 finalize_command="$finalize_command @SYMFILE@"
1599 *.la | *.lo) ;; # We handle these cases below.
1601 if test "$dlself" = no; then
1609 if test "$prev" = dlprefiles; then
1611 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1621 if test "$prev" = dlfiles; then
1622 dlfiles="$dlfiles $arg"
1624 dlprefiles="$dlprefiles $arg"
1632 export_symbols="$arg"
1633 if test ! -f "$arg"; then
1634 $echo "$modename: symbol file \`$arg' does not exist"
1641 export_symbols_regex="$arg"
1646 inst_prefix_dir="$arg"
1651 precious_files_regex="$arg"
1661 if test -f "$arg"; then
1664 for fil in `cat $save_arg`
1666 # moreargs="$moreargs $fil"
1668 # A libtool-controlled object.
1670 # Check to see that this really is a libtool object.
1671 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1676 # If there is no directory component, then add one.
1678 */* | *\\*) . $arg ;;
1682 if test -z "$pic_object" || \
1683 test -z "$non_pic_object" ||
1684 test "$pic_object" = none && \
1685 test "$non_pic_object" = none; then
1686 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1690 # Extract subdirectory from the argument.
1691 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1692 if test "X$xdir" = "X$arg"; then
1698 if test "$pic_object" != none; then
1699 # Prepend the subdirectory the object is found in.
1700 pic_object="$xdir$pic_object"
1702 if test "$prev" = dlfiles; then
1703 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1704 dlfiles="$dlfiles $pic_object"
1708 # If libtool objects are unsupported, then we need to preload.
1713 # CHECK ME: I think I busted this. -Ossama
1714 if test "$prev" = dlprefiles; then
1715 # Preload the old-style object.
1716 dlprefiles="$dlprefiles $pic_object"
1721 libobjs="$libobjs $pic_object"
1726 if test "$non_pic_object" != none; then
1727 # Prepend the subdirectory the object is found in.
1728 non_pic_object="$xdir$non_pic_object"
1730 # A standard non-PIC object
1731 non_pic_objects="$non_pic_objects $non_pic_object"
1732 if test -z "$pic_object" || test "$pic_object" = none ; then
1733 arg="$non_pic_object"
1736 # If the PIC object exists, use it instead.
1737 # $xdir was prepended to $pic_object above.
1738 non_pic_object="$pic_object"
1739 non_pic_objects="$non_pic_objects $non_pic_object"
1742 # Only an error if not doing a dry-run.
1743 if test -z "$run"; then
1744 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1749 # Extract subdirectory from the argument.
1750 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1751 if test "X$xdir" = "X$arg"; then
1757 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1758 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1759 libobjs="$libobjs $pic_object"
1760 non_pic_objects="$non_pic_objects $non_pic_object"
1765 $echo "$modename: link input file \`$save_arg' does not exist"
1773 # We need an absolute path.
1775 [\\/]* | [A-Za-z]:[\\/]*) ;;
1777 $echo "$modename: only absolute run-paths are allowed" 1>&2
1781 if test "$prev" = rpath; then
1784 *) rpath="$rpath $arg" ;;
1789 *) xrpath="$xrpath $arg" ;;
1796 compiler_flags="$compiler_flags $qarg"
1798 compile_command="$compile_command $qarg"
1799 finalize_command="$finalize_command $qarg"
1803 linker_flags="$linker_flags $qarg"
1804 compiler_flags="$compiler_flags $wl$qarg"
1806 compile_command="$compile_command $wl$qarg"
1807 finalize_command="$finalize_command $wl$qarg"
1811 linker_flags="$linker_flags $qarg"
1812 compiler_flags="$compiler_flags $qarg"
1814 compile_command="$compile_command $qarg"
1815 finalize_command="$finalize_command $qarg"
1823 darwin_framework|darwin_framework_skip)
1824 test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
1825 compile_command="$compile_command $arg"
1826 finalize_command="$finalize_command $arg"
1831 eval "$prev=\"\$arg\""
1836 fi # test -n "$prev"
1842 if test -n "$link_static_flag"; then
1843 compile_command="$compile_command $link_static_flag"
1844 finalize_command="$finalize_command $link_static_flag"
1850 # FIXME: remove this flag sometime in the future.
1851 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1875 -export-symbols | -export-symbols-regex)
1876 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1877 $echo "$modename: more than one -exported-symbols argument is not allowed"
1880 if test "X$arg" = "X-export-symbols"; then
1888 -framework|-arch|-isysroot)
1890 *" ${arg} ${1} "* | *" ${arg} ${1} "*)
1891 prev=darwin_framework_skip ;;
1892 *) compiler_flags="$compiler_flags $arg"
1893 prev=darwin_framework ;;
1895 compile_command="$compile_command $arg"
1896 finalize_command="$finalize_command $arg"
1905 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1906 # so, if we see these flags be careful not to treat them like -L
1908 case $with_gcc/$host in
1909 no/*-*-irix* | /*-*-irix*)
1910 compile_command="$compile_command $arg"
1911 finalize_command="$finalize_command $arg"
1918 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1919 # We need an absolute path.
1921 [\\/]* | [A-Za-z]:[\\/]*) ;;
1923 absdir=`cd "$dir" && pwd`
1924 if test -z "$absdir"; then
1925 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1927 notinst_path="$notinst_path $dir"
1935 deplibs="$deplibs -L$dir"
1936 lib_search_path="$lib_search_path $dir"
1940 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1941 testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1942 case :$dllsearchpath: in
1944 *) dllsearchpath="$dllsearchpath:$dir";;
1946 case :$dllsearchpath: in
1947 *":$testbindir:"*) ;;
1948 *) dllsearchpath="$dllsearchpath:$testbindir";;
1956 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1958 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
1959 # These systems don't actually have a C or math library (as such)
1963 # These systems don't actually have a C library (as such)
1964 test "X$arg" = "X-lc" && continue
1966 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1967 # Do not include libc due to us having libc/libc_r.
1968 test "X$arg" = "X-lc" && continue
1970 *-*-rhapsody* | *-*-darwin1.[012])
1971 # Rhapsody C and math libraries are in the System framework
1972 deplibs="$deplibs -framework System"
1975 *-*-sco3.2v5* | *-*-sco5v6*)
1976 # Causes problems with __ctype
1977 test "X$arg" = "X-lc" && continue
1979 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
1980 # Compiler inserts libc in the correct place for threads to work
1981 test "X$arg" = "X-lc" && continue
1984 elif test "X$arg" = "X-lc_r"; then
1986 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1987 # Do not include libc_r directly, use -pthread flag.
1992 deplibs="$deplibs $arg"
1996 # Tru64 UNIX uses -model [arg] to determine the layout of C++
1997 # classes, name mangling, and exception handling.
1999 compile_command="$compile_command $arg"
2000 compiler_flags="$compiler_flags $arg"
2001 finalize_command="$finalize_command $arg"
2006 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
2007 compiler_flags="$compiler_flags $arg"
2008 compile_command="$compile_command $arg"
2009 finalize_command="$finalize_command $arg"
2014 single_module="${wl}-multi_module"
2023 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
2024 # -r[0-9][0-9]* specifies the processor on the SGI compiler
2025 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
2026 # +DA*, +DD* enable 64-bit mode on the HP compiler
2027 # -q* pass through compiler args for the IBM compiler
2028 # -m* pass through architecture-specific compiler args for GCC
2029 # -m*, -t[45]*, -txscale* pass through architecture-specific
2030 # compiler args for GCC
2031 # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
2032 # -F/path gives path to uninstalled frameworks, gcc on darwin
2033 # @file GCC response files
2034 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
2035 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
2037 # Unknown arguments in both finalize_command and compile_command need
2038 # to be aesthetically quoted because they are evaled later.
2039 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2041 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2045 compile_command="$compile_command $arg"
2046 finalize_command="$finalize_command $arg"
2047 compiler_flags="$compiler_flags $arg"
2063 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
2064 # The PATH hackery in wrapper scripts is required on Windows
2065 # and Darwin in order for the loader to find any dlls it needs.
2066 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
2067 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
2070 *) no_install=yes ;;
2087 -precious-files-regex)
2108 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
2109 # We need an absolute path.
2111 [\\/]* | [A-Za-z]:[\\/]*) ;;
2113 $echo "$modename: only absolute run-paths are allowed" 1>&2
2119 *) xrpath="$xrpath $dir" ;;
2124 -static | -static-libtool-libs)
2125 # The effects of -static are defined in a previous loop.
2126 # We used to do the same as -all-static on platforms that
2127 # didn't have a PIC flag, but the assumption that the effects
2128 # would be equivalent was wrong. It would break on at least
2129 # Digital Unix and AIX.
2149 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
2151 save_ifs="$IFS"; IFS=','
2152 for flag in $args; do
2155 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2160 compiler_flags="$compiler_flags $flag"
2163 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
2167 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
2169 save_ifs="$IFS"; IFS=','
2170 for flag in $args; do
2173 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2178 compiler_flags="$compiler_flags $wl$flag"
2179 linker_flags="$linker_flags $flag"
2182 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
2200 # Some other compiler flag.
2202 # Unknown arguments in both finalize_command and compile_command need
2203 # to be aesthetically quoted because they are evaled later.
2204 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2206 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2213 # A standard object.
2218 # A libtool-controlled object.
2220 # Check to see that this really is a libtool object.
2221 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2226 # If there is no directory component, then add one.
2228 */* | *\\*) . $arg ;;
2232 if test -z "$pic_object" || \
2233 test -z "$non_pic_object" ||
2234 test "$pic_object" = none && \
2235 test "$non_pic_object" = none; then
2236 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
2240 # Extract subdirectory from the argument.
2241 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2242 if test "X$xdir" = "X$arg"; then
2248 if test "$pic_object" != none; then
2249 # Prepend the subdirectory the object is found in.
2250 pic_object="$xdir$pic_object"
2252 if test "$prev" = dlfiles; then
2253 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
2254 dlfiles="$dlfiles $pic_object"
2258 # If libtool objects are unsupported, then we need to preload.
2263 # CHECK ME: I think I busted this. -Ossama
2264 if test "$prev" = dlprefiles; then
2265 # Preload the old-style object.
2266 dlprefiles="$dlprefiles $pic_object"
2271 libobjs="$libobjs $pic_object"
2276 if test "$non_pic_object" != none; then
2277 # Prepend the subdirectory the object is found in.
2278 non_pic_object="$xdir$non_pic_object"
2280 # A standard non-PIC object
2281 non_pic_objects="$non_pic_objects $non_pic_object"
2282 if test -z "$pic_object" || test "$pic_object" = none ; then
2283 arg="$non_pic_object"
2286 # If the PIC object exists, use it instead.
2287 # $xdir was prepended to $pic_object above.
2288 non_pic_object="$pic_object"
2289 non_pic_objects="$non_pic_objects $non_pic_object"
2292 # Only an error if not doing a dry-run.
2293 if test -z "$run"; then
2294 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
2299 # Extract subdirectory from the argument.
2300 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2301 if test "X$xdir" = "X$arg"; then
2307 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
2308 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
2309 libobjs="$libobjs $pic_object"
2310 non_pic_objects="$non_pic_objects $non_pic_object"
2317 deplibs="$deplibs $arg"
2318 old_deplibs="$old_deplibs $arg"
2323 # A libtool-controlled library.
2325 if test "$prev" = dlfiles; then
2326 # This library was specified with -dlopen.
2327 dlfiles="$dlfiles $arg"
2329 elif test "$prev" = dlprefiles; then
2330 # The library was specified with -dlpreopen.
2331 dlprefiles="$dlprefiles $arg"
2334 deplibs="$deplibs $arg"
2339 # Some other compiler argument.
2341 # Unknown arguments in both finalize_command and compile_command need
2342 # to be aesthetically quoted because they are evaled later.
2343 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2345 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2352 # Now actually substitute the argument into the commands.
2353 if test -n "$arg"; then
2354 compile_command="$compile_command $arg"
2355 finalize_command="$finalize_command $arg"
2357 done # argument parsing loop
2359 if test -n "$prev"; then
2360 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
2365 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
2366 eval arg=\"$export_dynamic_flag_spec\"
2367 compile_command="$compile_command $arg"
2368 finalize_command="$finalize_command $arg"
2372 # calculate the name of the file, without its directory
2373 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
2374 libobjs_save="$libobjs"
2376 if test -n "$shlibpath_var"; then
2377 # get the directories listed in $shlibpath_var
2378 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2382 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
2383 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
2385 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2386 if test "X$output_objdir" = "X$output"; then
2387 output_objdir="$objdir"
2389 output_objdir="$output_objdir/$objdir"
2391 # Create the object directory.
2392 if test ! -d "$output_objdir"; then
2393 $show "$mkdir $output_objdir"
2394 $run $mkdir $output_objdir
2396 if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
2401 # Determine the type of output
2404 $echo "$modename: you must specify an output file" 1>&2
2408 *.$libext) linkmode=oldlib ;;
2409 *.lo | *.$objext) linkmode=obj ;;
2410 *.la) linkmode=lib ;;
2411 *) linkmode=prog ;; # Anything else should be a program.
2415 *cygwin* | *mingw* | *pw32*)
2416 # don't eliminate duplications in $postdeps and $predeps
2417 duplicate_compiler_generated_deps=yes
2420 duplicate_compiler_generated_deps=$duplicate_deps
2426 # Find all interdependent deplibs by searching for libraries
2427 # that are linked more than once (e.g. -la -lb -la)
2428 for deplib in $deplibs; do
2429 if test "X$duplicate_deps" = "Xyes" ; then
2431 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2434 libs="$libs $deplib"
2437 if test "$linkmode" = lib; then
2438 libs="$predeps $libs $compiler_lib_search_path $postdeps"
2440 # Compute libraries that are listed more than once in $predeps
2441 # $postdeps and mark them as special (i.e., whose duplicates are
2442 # not to be eliminated).
2444 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2445 for pre_post_dep in $predeps $postdeps; do
2446 case "$pre_post_deps " in
2447 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
2449 pre_post_deps="$pre_post_deps $pre_post_dep"
2458 need_relink=no # whether we're linking any uninstalled libtool libraries
2459 notinst_deplibs= # not-installed libtool libraries
2463 for file in $dlfiles $dlprefiles; do
2467 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2479 passes="conv scan dlopen dlpreopen link"
2484 for pass in $passes; do
2485 if test "$linkmode,$pass" = "lib,link" ||
2486 test "$linkmode,$pass" = "prog,scan"; then
2490 if test "$linkmode" = prog; then
2492 dlopen) libs="$dlfiles" ;;
2493 dlpreopen) libs="$dlprefiles" ;;
2494 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2497 if test "$pass" = dlopen; then
2498 # Collect dlpreopened libraries
2499 save_deplibs="$deplibs"
2502 for deplib in $libs; do
2506 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
2507 if test "$linkmode,$pass" = "prog,link"; then
2508 compile_deplibs="$deplib $compile_deplibs"
2509 finalize_deplibs="$deplib $finalize_deplibs"
2511 compiler_flags="$compiler_flags $deplib"
2516 if test "$linkmode" != lib && test "$linkmode" != prog; then
2517 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2520 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2521 if test "$linkmode" = lib; then
2522 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
2524 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
2526 for searchdir in $searchdirs; do
2527 for search_ext in .la $std_shrext .so .a; do
2528 # Search the libtool library
2529 lib="$searchdir/lib${name}${search_ext}"
2530 if test -f "$lib"; then
2531 if test "$search_ext" = ".la"; then
2540 if test "$found" != yes; then
2541 # deplib doesn't seem to be a libtool library
2542 if test "$linkmode,$pass" = "prog,link"; then
2543 compile_deplibs="$deplib $compile_deplibs"
2544 finalize_deplibs="$deplib $finalize_deplibs"
2546 deplibs="$deplib $deplibs"
2547 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2550 else # deplib is a libtool library
2551 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2552 # We need to do some special things here, and not later.
2553 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2554 case " $predeps $postdeps " in
2556 if (${SED} -e '2q' $lib |
2557 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2561 */* | *\\*) . $lib ;;
2564 for l in $old_library $library_names; do
2567 if test "X$ll" = "X$old_library" ; then # only static version available
2569 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2570 test "X$ladir" = "X$lib" && ladir="."
2571 lib=$ladir/$old_library
2572 if test "$linkmode,$pass" = "prog,link"; then
2573 compile_deplibs="$deplib $compile_deplibs"
2574 finalize_deplibs="$deplib $finalize_deplibs"
2576 deplibs="$deplib $deplibs"
2577 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2591 deplibs="$deplib $deplibs"
2592 test "$pass" = conv && continue
2593 newdependency_libs="$deplib $newdependency_libs"
2594 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2597 if test "$pass" = conv; then
2598 deplibs="$deplib $deplibs"
2601 if test "$pass" = scan; then
2602 deplibs="$deplib $deplibs"
2604 compile_deplibs="$deplib $compile_deplibs"
2605 finalize_deplibs="$deplib $finalize_deplibs"
2607 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2610 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2616 if test "$pass" = link; then
2617 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2618 # Make sure the xrpath contains only unique directories.
2621 *) xrpath="$xrpath $dir" ;;
2624 deplibs="$deplib $deplibs"
2627 *.la) lib="$deplib" ;;
2629 if test "$pass" = conv; then
2630 deplibs="$deplib $deplibs"
2636 case $deplibs_check_method in
2638 set dummy $deplibs_check_method
2639 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2640 if eval $echo \"$deplib\" 2>/dev/null \
2642 | $EGREP "$match_pattern_regex" > /dev/null; then
2650 if test "$valid_a_lib" != yes; then
2652 $echo "*** Warning: Trying to link with static lib archive $deplib."
2653 $echo "*** I have the capability to make that library automatically link in when"
2654 $echo "*** you link to this library. But I can only do this if you have a"
2655 $echo "*** shared version of the library, which you do not appear to have"
2656 $echo "*** because the file extensions .$libext of this argument makes me believe"
2657 $echo "*** that it is just a static archive that I should not used here."
2660 $echo "*** Warning: Linking the shared library $output against the"
2661 $echo "*** static library $deplib is not portable!"
2662 deplibs="$deplib $deplibs"
2667 if test "$pass" != link; then
2668 deplibs="$deplib $deplibs"
2670 compile_deplibs="$deplib $compile_deplibs"
2671 finalize_deplibs="$deplib $finalize_deplibs"
2678 if test "$pass" = conv; then
2679 deplibs="$deplib $deplibs"
2680 elif test "$linkmode" = prog; then
2681 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2682 # If there is no dlopen support or we're linking statically,
2683 # we need to preload.
2684 newdlprefiles="$newdlprefiles $deplib"
2685 compile_deplibs="$deplib $compile_deplibs"
2686 finalize_deplibs="$deplib $finalize_deplibs"
2688 newdlfiles="$newdlfiles $deplib"
2698 if test "$found" = yes || test -f "$lib"; then :
2700 $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
2704 # Check to see that this really is a libtool archive.
2705 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2707 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2711 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2712 test "X$ladir" = "X$lib" && ladir="."
2720 # If the library was installed with an old release of libtool,
2721 # it will not redefine variables installed, or shouldnotlink
2729 */* | *\\*) . $lib ;;
2733 if test "$linkmode,$pass" = "lib,link" ||
2734 test "$linkmode,$pass" = "prog,scan" ||
2735 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2736 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2737 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2740 if test "$pass" = conv; then
2741 # Only check for convenience libraries
2742 deplibs="$lib $deplibs"
2743 if test -z "$libdir"; then
2744 if test -z "$old_library"; then
2745 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2748 # It is a libtool convenience library, so add in its objects.
2749 convenience="$convenience $ladir/$objdir/$old_library"
2750 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2752 for deplib in $dependency_libs; do
2753 deplibs="$deplib $deplibs"
2754 if test "X$duplicate_deps" = "Xyes" ; then
2755 case "$tmp_libs " in
2756 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2759 tmp_libs="$tmp_libs $deplib"
2761 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2762 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2769 # Get the name of the library we link against.
2771 for l in $old_library $library_names; do
2774 if test -z "$linklib"; then
2775 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2779 # This library was specified with -dlopen.
2780 if test "$pass" = dlopen; then
2781 if test -z "$libdir"; then
2782 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2785 if test -z "$dlname" ||
2786 test "$dlopen_support" != yes ||
2787 test "$build_libtool_libs" = no; then
2788 # If there is no dlname, no dlopen support or we're linking
2789 # statically, we need to preload. We also need to preload any
2790 # dependent libraries so libltdl's deplib preloader doesn't
2791 # bomb out in the load deplibs phase.
2792 dlprefiles="$dlprefiles $lib $dependency_libs"
2794 newdlfiles="$newdlfiles $lib"
2799 # We need an absolute path.
2801 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2803 abs_ladir=`cd "$ladir" && pwd`
2804 if test -z "$abs_ladir"; then
2805 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2806 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2811 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2813 # Find the relevant object directory and library name.
2814 if test "X$installed" = Xyes; then
2815 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2816 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2824 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2826 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2829 # Remove this search path later
2830 notinst_path="$notinst_path $abs_ladir"
2832 dir="$ladir/$objdir"
2833 absdir="$abs_ladir/$objdir"
2834 # Remove this search path later
2835 notinst_path="$notinst_path $abs_ladir"
2837 fi # $installed = yes
2838 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2840 # This library was specified with -dlpreopen.
2841 if test "$pass" = dlpreopen; then
2842 if test -z "$libdir"; then
2843 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2846 # Prefer using a static library (so that no silly _DYNAMIC symbols
2847 # are required to link).
2848 if test -n "$old_library"; then
2849 newdlprefiles="$newdlprefiles $dir/$old_library"
2850 # Otherwise, use the dlname, so that lt_dlopen finds it.
2851 elif test -n "$dlname"; then
2852 newdlprefiles="$newdlprefiles $dir/$dlname"
2854 newdlprefiles="$newdlprefiles $dir/$linklib"
2856 fi # $pass = dlpreopen
2858 if test -z "$libdir"; then
2859 # Link the convenience library
2860 if test "$linkmode" = lib; then
2861 deplibs="$dir/$old_library $deplibs"
2862 elif test "$linkmode,$pass" = "prog,link"; then
2863 compile_deplibs="$dir/$old_library $compile_deplibs"
2864 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2866 deplibs="$lib $deplibs" # used for prog,scan pass
2872 if test "$linkmode" = prog && test "$pass" != link; then
2873 newlib_search_path="$newlib_search_path $ladir"
2874 deplibs="$lib $deplibs"
2877 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2878 test "$build_libtool_libs" = no; then
2883 for deplib in $dependency_libs; do
2885 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2887 # Need to link against all dependency_libs?
2888 if test "$linkalldeplibs" = yes; then
2889 deplibs="$deplib $deplibs"
2891 # Need to hardcode shared library paths
2892 # or/and link against static libraries
2893 newdependency_libs="$deplib $newdependency_libs"
2895 if test "X$duplicate_deps" = "Xyes" ; then
2896 case "$tmp_libs " in
2897 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2900 tmp_libs="$tmp_libs $deplib"
2903 fi # $linkmode = prog...
2905 if test "$linkmode,$pass" = "prog,link"; then
2906 if test -n "$library_names" &&
2907 { { test "$prefer_static_libs" = no ||
2908 test "$prefer_static_libs,$installed" = "built,yes"; } ||
2909 test -z "$old_library"; }; then
2910 # We need to hardcode the library path
2911 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2912 # Make sure the rpath contains only unique directories.
2913 case "$temp_rpath " in
2916 *) temp_rpath="$temp_rpath $absdir" ;;
2920 # Hardcode the library path.
2921 # Skip directories that are in the system default run-time
2923 case " $sys_lib_dlsearch_path " in
2926 case "$compile_rpath " in
2928 *) compile_rpath="$compile_rpath $absdir"
2932 case " $sys_lib_dlsearch_path " in
2935 case "$finalize_rpath " in
2937 *) finalize_rpath="$finalize_rpath $libdir"
2941 fi # $linkmode,$pass = prog,link...
2943 if test "$alldeplibs" = yes &&
2944 { test "$deplibs_check_method" = pass_all ||
2945 { test "$build_libtool_libs" = yes &&
2946 test -n "$library_names"; }; }; then
2947 # We only need to search for static libraries
2952 link_static=no # Whether the deplib will be linked statically
2953 use_static_libs=$prefer_static_libs
2954 if test "$use_static_libs" = built && test "$installed" = yes ; then
2957 if test -n "$library_names" &&
2958 { test "$use_static_libs" = no || test -z "$old_library"; }; then
2959 if test "$installed" = no; then
2960 notinst_deplibs="$notinst_deplibs $lib"
2963 # This is a shared library
2965 # Warn about portability, can't link against -module's on
2966 # some systems (darwin)
2967 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2969 if test "$linkmode" = prog; then
2970 $echo "*** Warning: Linking the executable $output against the loadable module"
2972 $echo "*** Warning: Linking the shared library $output against the loadable module"
2974 $echo "*** $linklib is not portable!"
2976 if test "$linkmode" = lib &&
2977 test "$hardcode_into_libs" = yes; then
2978 # Hardcode the library path.
2979 # Skip directories that are in the system default run-time
2981 case " $sys_lib_dlsearch_path " in
2984 case "$compile_rpath " in
2986 *) compile_rpath="$compile_rpath $absdir"
2990 case " $sys_lib_dlsearch_path " in
2993 case "$finalize_rpath " in
2995 *) finalize_rpath="$finalize_rpath $libdir"
3001 if test -n "$old_archive_from_expsyms_cmds"; then
3002 # figure out the soname
3003 set dummy $library_names
3006 libname=`eval \\$echo \"$libname_spec\"`
3007 # use dlname if we got it. it's perfectly good, no?
3008 if test -n "$dlname"; then
3010 elif test -n "$soname_spec"; then
3014 major=`expr $current - $age`
3018 eval soname=\"$soname_spec\"
3023 # Make a new name for the extract_expsyms_cmds to use
3025 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
3026 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
3028 # If the library has no export list, then create one now
3029 if test -f "$output_objdir/$soname-def"; then :
3031 $show "extracting exported symbol list from \`$soname'"
3032 save_ifs="$IFS"; IFS='~'
3033 cmds=$extract_expsyms_cmds
3034 for cmd in $cmds; do
3038 $run eval "$cmd" || exit $?
3044 if test -f "$output_objdir/$newlib"; then :; else
3045 $show "generating import library for \`$soname'"
3046 save_ifs="$IFS"; IFS='~'
3047 cmds=$old_archive_from_expsyms_cmds
3048 for cmd in $cmds; do
3052 $run eval "$cmd" || exit $?
3056 # make sure the library variables are pointing to the new library
3059 fi # test -n "$old_archive_from_expsyms_cmds"
3061 if test "$linkmode" = prog || test "$mode" != relink; then
3066 case $hardcode_action in
3067 immediate | unsupported)
3068 if test "$hardcode_direct" = no; then
3071 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
3072 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
3073 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
3074 *-*-unixware7*) add_dir="-L$dir" ;;
3076 # if the lib is a module then we can not link against
3077 # it, someone is ignoring the new warnings I added
3078 if /usr/bin/file -L $add 2> /dev/null |
3079 $EGREP ": [^:]* bundle" >/dev/null ; then
3080 $echo "** Warning, lib $linklib is a module, not a shared library"
3081 if test -z "$old_library" ; then
3083 $echo "** And there doesn't seem to be a static archive available"
3084 $echo "** The link will probably fail, sorry"
3086 add="$dir/$old_library"
3090 elif test "$hardcode_minus_L" = no; then
3092 *-*-sunos*) add_shlibpath="$dir" ;;
3096 elif test "$hardcode_shlibpath_var" = no; then
3097 add_shlibpath="$dir"
3104 if test "$hardcode_direct" = yes; then
3106 elif test "$hardcode_minus_L" = yes; then
3108 # Try looking first in the location we're being installed to.
3109 if test -n "$inst_prefix_dir"; then
3112 add_dir="$add_dir -L$inst_prefix_dir$libdir"
3117 elif test "$hardcode_shlibpath_var" = yes; then
3118 add_shlibpath="$dir"
3127 if test "$lib_linked" != yes; then
3128 $echo "$modename: configuration error: unsupported hardcode properties"
3132 if test -n "$add_shlibpath"; then
3133 case :$compile_shlibpath: in
3134 *":$add_shlibpath:"*) ;;
3135 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
3138 if test "$linkmode" = prog; then
3139 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
3140 test -n "$add" && compile_deplibs="$add $compile_deplibs"
3142 test -n "$add_dir" && deplibs="$add_dir $deplibs"
3143 test -n "$add" && deplibs="$add $deplibs"
3144 if test "$hardcode_direct" != yes && \
3145 test "$hardcode_minus_L" != yes && \
3146 test "$hardcode_shlibpath_var" = yes; then
3147 case :$finalize_shlibpath: in
3149 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
3155 if test "$linkmode" = prog || test "$mode" = relink; then
3159 # Finalize command for both is simple: just hardcode it.
3160 if test "$hardcode_direct" = yes; then
3161 add="$libdir/$linklib"
3162 elif test "$hardcode_minus_L" = yes; then
3165 elif test "$hardcode_shlibpath_var" = yes; then
3166 case :$finalize_shlibpath: in
3168 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
3171 elif test "$hardcode_automatic" = yes; then
3172 if test -n "$inst_prefix_dir" &&
3173 test -f "$inst_prefix_dir$libdir/$linklib" ; then
3174 add="$inst_prefix_dir$libdir/$linklib"
3176 add="$libdir/$linklib"
3179 # We cannot seem to hardcode it, guess we'll fake it.
3181 # Try looking first in the location we're being installed to.
3182 if test -n "$inst_prefix_dir"; then
3185 add_dir="$add_dir -L$inst_prefix_dir$libdir"
3192 if test "$linkmode" = prog; then
3193 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
3194 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
3196 test -n "$add_dir" && deplibs="$add_dir $deplibs"
3197 test -n "$add" && deplibs="$add $deplibs"
3200 elif test "$linkmode" = prog; then
3201 # Here we assume that one of hardcode_direct or hardcode_minus_L
3202 # is not unsupported. This is valid on all known static and
3204 if test "$hardcode_direct" != unsupported; then
3205 test -n "$old_library" && linklib="$old_library"
3206 compile_deplibs="$dir/$linklib $compile_deplibs"
3207 finalize_deplibs="$dir/$linklib $finalize_deplibs"
3209 compile_deplibs="-l$name -L$dir $compile_deplibs"
3210 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
3212 elif test "$build_libtool_libs" = yes; then
3213 # Not a shared library
3214 if test "$deplibs_check_method" != pass_all; then
3215 # We're trying link a shared library against a static one
3216 # but the system doesn't support it.
3218 # Just print a warning and add the library to dependency_libs so
3219 # that the program can be linked against the static library.
3221 $echo "*** Warning: This system can not link to static lib archive $lib."
3222 $echo "*** I have the capability to make that library automatically link in when"
3223 $echo "*** you link to this library. But I can only do this if you have a"
3224 $echo "*** shared version of the library, which you do not appear to have."
3225 if test "$module" = yes; then
3226 $echo "*** But as you try to build a module library, libtool will still create "
3227 $echo "*** a static module, that should work as long as the dlopening application"
3228 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
3229 if test -z "$global_symbol_pipe"; then
3231 $echo "*** However, this would only work if libtool was able to extract symbol"
3232 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3233 $echo "*** not find such a program. So, this module is probably useless."
3234 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3236 if test "$build_old_libs" = no; then
3237 build_libtool_libs=module
3240 build_libtool_libs=no
3244 deplibs="$dir/$old_library $deplibs"
3247 fi # link shared/static library?
3249 if test "$linkmode" = lib; then
3250 if test -n "$dependency_libs" &&
3251 { test "$hardcode_into_libs" != yes ||
3252 test "$build_old_libs" = yes ||
3253 test "$link_static" = yes; }; then
3254 # Extract -R from dependency_libs
3256 for libdir in $dependency_libs; do
3258 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
3260 *" $temp_xrpath "*) ;;
3261 *) xrpath="$xrpath $temp_xrpath";;
3263 *) temp_deplibs="$temp_deplibs $libdir";;
3266 dependency_libs="$temp_deplibs"
3269 newlib_search_path="$newlib_search_path $absdir"
3270 # Link against this library
3271 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
3272 # ... and its dependency_libs
3274 for deplib in $dependency_libs; do
3275 newdependency_libs="$deplib $newdependency_libs"
3276 if test "X$duplicate_deps" = "Xyes" ; then
3277 case "$tmp_libs " in
3278 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
3281 tmp_libs="$tmp_libs $deplib"
3284 if test "$link_all_deplibs" != no; then
3285 # Add the search paths of all dependency libraries
3286 for deplib in $dependency_libs; do
3288 -L*) path="$deplib" ;;
3290 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
3291 test "X$dir" = "X$deplib" && dir="."
3292 # We need an absolute path.
3294 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
3296 absdir=`cd "$dir" && pwd`
3297 if test -z "$absdir"; then
3298 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
3303 if grep "^installed=no" $deplib > /dev/null; then
3304 path="$absdir/$objdir"
3306 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3307 if test -z "$libdir"; then
3308 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3311 if test "$absdir" != "$libdir"; then
3312 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
3319 # we do not want to link against static libs,
3320 # but need to link against shared
3321 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
3322 eval deplibdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3323 if test -n "$deplibrary_names" ; then
3324 for tmp in $deplibrary_names ; do
3327 if test -f "$deplibdir/$depdepl" ; then
3328 depdepl="$deplibdir/$depdepl"
3329 elif test -f "$path/$depdepl" ; then
3330 depdepl="$path/$depdepl"
3332 # Can't find it, oh well...
3335 # do not add paths which are already there
3336 case " $newlib_search_path " in
3338 *) newlib_search_path="$newlib_search_path $path";;
3351 # Again, we only want to link against shared libraries
3352 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
3353 for tmp in $newlib_search_path ; do
3354 if test -f "$tmp/lib$tmp_libs.dylib" ; then
3355 eval depdepl="$tmp/lib$tmp_libs.dylib"
3366 case " $deplibs " in
3368 *) deplibs="$path $deplibs" ;;
3370 case " $deplibs " in
3372 *) deplibs="$depdepl $deplibs" ;;
3375 fi # link_all_deplibs != no
3377 done # for deplib in $libs
3378 dependency_libs="$newdependency_libs"
3379 if test "$pass" = dlpreopen; then
3380 # Link the dlpreopened libraries before other libraries
3381 for deplib in $save_deplibs; do
3382 deplibs="$deplib $deplibs"
3385 if test "$pass" != dlopen; then
3386 if test "$pass" != conv; then
3387 # Make sure lib_search_path contains only unique directories.
3389 for dir in $newlib_search_path; do
3390 case "$lib_search_path " in
3392 *) lib_search_path="$lib_search_path $dir" ;;
3398 if test "$linkmode,$pass" != "prog,link"; then
3401 vars="compile_deplibs finalize_deplibs"
3403 for var in $vars dependency_libs; do
3404 # Add libraries to $var in reverse order
3405 eval tmp_libs=\"\$$var\"
3407 for deplib in $tmp_libs; do
3408 # FIXME: Pedantically, this is the right thing to do, so
3409 # that some nasty dependency loop isn't accidentally
3411 #new_libs="$deplib $new_libs"
3412 # Pragmatically, this seems to cause very few problems in
3415 -L*) new_libs="$deplib $new_libs" ;;
3418 # And here is the reason: when a library appears more
3419 # than once as an explicit dependence of a library, or
3420 # is implicitly linked in more than once by the
3421 # compiler, it is considered special, and multiple
3422 # occurrences thereof are not removed. Compare this
3423 # with having the same library being listed as a
3424 # dependency of multiple other libraries: in this case,
3425 # we know (pedantically, we assume) the library does not
3426 # need to be listed more than once, so we keep only the
3427 # last copy. This is not always right, but it is rare
3428 # enough that we require users that really mean to play
3429 # such unportable linking tricks to link the library
3430 # using -Wl,-lname, so that libtool does not consider it
3431 # for duplicate removal.
3432 case " $specialdeplibs " in
3433 *" $deplib "*) new_libs="$deplib $new_libs" ;;
3435 case " $new_libs " in
3437 *) new_libs="$deplib $new_libs" ;;
3445 for deplib in $new_libs; do
3448 case " $tmp_libs " in
3450 *) tmp_libs="$tmp_libs $deplib" ;;
3453 *) tmp_libs="$tmp_libs $deplib" ;;
3456 eval $var=\"$tmp_libs\"
3459 # Last step: remove runtime libs from dependency_libs
3460 # (they stay in deplibs)
3462 for i in $dependency_libs ; do
3463 case " $predeps $postdeps $compiler_lib_search_path " in
3468 if test -n "$i" ; then
3469 tmp_libs="$tmp_libs $i"
3472 dependency_libs=$tmp_libs
3474 if test "$linkmode" = prog; then
3475 dlfiles="$newdlfiles"
3476 dlprefiles="$newdlprefiles"
3483 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 ;;
3486 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3487 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3490 if test -n "$rpath"; then
3491 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3494 if test -n "$xrpath"; then
3495 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3498 if test -n "$vinfo"; then
3499 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3502 if test -n "$release"; then
3503 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3506 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3507 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3510 # Now set the variables for building old libraries.
3511 build_libtool_libs=no
3513 objs="$objs$old_deplibs"
3517 # Make sure we only generate libraries of the form `libNAME.la'.
3520 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3521 eval shared_ext=\"$shrext_cmds\"
3522 eval libname=\"$libname_spec\"
3525 if test "$module" = no; then
3526 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3530 if test "$need_lib_prefix" != no; then
3531 # Add the "lib" prefix for modules if required
3532 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3533 eval shared_ext=\"$shrext_cmds\"
3534 eval libname=\"$libname_spec\"
3536 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3541 if test -n "$objs"; then
3542 if test "$deplibs_check_method" != pass_all; then
3543 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3547 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3548 $echo "*** objects $objs is not portable!"
3549 libobjs="$libobjs $objs"
3553 if test "$dlself" != no; then
3554 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3558 if test "$#" -gt 2; then
3559 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3564 if test -z "$rpath"; then
3565 if test "$build_libtool_libs" = yes; then
3566 # Building a libtool convenience library.
3567 # Some compilers have problems with a `.al' extension so
3568 # convenience libraries should have the same extension an
3569 # archive normally would.
3570 oldlibs="$output_objdir/$libname.$libext $oldlibs"
3571 build_libtool_libs=convenience
3575 if test -n "$vinfo"; then
3576 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3579 if test -n "$release"; then
3580 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3584 # Parse the version information argument.
3585 save_ifs="$IFS"; IFS=':'
3586 set dummy $vinfo 0 0 0
3589 if test -n "$8"; then
3590 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3595 # convert absolute version numbers to libtool ages
3596 # this retains compatibility with .la files and attempts
3597 # to make the code below a bit more comprehensible
3599 case $vinfo_number in
3603 number_revision="$4"
3605 # There are really only two kinds -- those that
3606 # use the current revision as the major version
3607 # and those that subtract age and use age as
3608 # a minor version. But, then there is irix
3609 # which has an extra 1 added just for fun
3611 case $version_type in
3612 darwin|linux|osf|windows|none)
3613 current=`expr $number_major + $number_minor`
3615 revision="$number_revision"
3617 freebsd-aout|freebsd-elf|sunos)
3618 current="$number_major"
3619 revision="$number_minor"
3623 current=`expr $number_major + $number_minor`
3625 revision="$number_minor"
3626 lt_irix_increment=no
3637 # Check that each of the things are valid numbers.
3639 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]) ;;
3641 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3642 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3648 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]) ;;
3650 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3651 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3657 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]) ;;
3659 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3660 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3665 if test "$age" -gt "$current"; then
3666 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3667 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3671 # Calculate the version variables.