3 # libtoolT - Provide generalized library-building support services.
4 # Generated automatically by (GNU simgrid 3.1.1-cvs)
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.
43 available_tags=" CXX F77"
45 # ### BEGIN LIBTOOL CONFIG
47 # Libtool was configured on host neutres:
49 # Shell to use when invoking shell scripts.
52 # Whether or not to build shared libraries.
53 build_libtool_libs=yes
55 # Whether or not to build static libraries.
58 # Whether or not to add -lc for building shared libraries.
59 build_libtool_need_lc=no
61 # Whether or not to disallow shared libs when runtime libs are static
62 allow_libtool_libs_with_static_runtimes=no
64 # Whether or not to optimize for fast installation.
69 host=i686-pc-linux-gnu
74 build=i686-pc-linux-gnu
77 # An echo program that does not interpret backslashes.
87 # LTCC compiler flags.
90 # A language-specific compiler.
93 # Is the compiler the GNU C compiler?
99 # The linker used to build libraries.
102 # Whether we need hard or soft links.
105 # A BSD-compatible nm program.
108 # A symbol stripping program
111 # Used to examine libraries when file_magic_cmd begins "file"
114 # Used on cygwin: DLL creation program.
117 # Used on cygwin: object dumper.
120 # Used on cygwin: assembler.
123 # The name of the directory that contains temporary libtool files.
126 # How to create reloadable object files.
128 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
130 # How to pass a linker flag through the compiler.
133 # Object file suffix (normally "o").
136 # Old archive suffix (normally "a").
139 # Shared library suffix (normally ".so").
142 # Executable file suffix (normally "").
145 # Additional compiler flags for building library objects.
146 pic_flag=" -fPIC -DPIC"
149 # What is the maximum length of a command?
152 # Does compiler simultaneously support -c and -o options?
155 # Must we lock files when doing compilation?
158 # Do we need the lib prefix for modules?
161 # Do we need a version for libraries?
164 # Whether dlopen is supported.
165 dlopen_support=unknown
167 # Whether dlopen of programs is supported.
170 # Whether dlopen of statically linked programs is supported.
171 dlopen_self_static=unknown
173 # Compiler flag to prevent dynamic linking.
174 link_static_flag="-static"
176 # Compiler flag to turn off builtin functions.
177 no_builtin_flag=" -fno-builtin"
179 # Compiler flag to allow reflexive dlopens.
180 export_dynamic_flag_spec="\${wl}--export-dynamic"
182 # Compiler flag to generate shared objects directly from archives.
183 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
185 # Compiler flag to generate thread-safe objects.
186 thread_safe_flag_spec=""
188 # Library versioning type.
191 # Format of library name prefix.
192 libname_spec="lib\$name"
194 # List of archive names. First name is the real one, the rest are links.
195 # The last name is the one that the linker finds with -lNAME.
196 library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
198 # The coded name of the library, if different from the real name.
199 soname_spec="\${libname}\${release}\${shared_ext}\$major"
201 # Commands used to build and install an old-style archive.
203 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
204 old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
205 old_postuninstall_cmds=""
207 # Create an old-style archive from a shared archive.
208 old_archive_from_new_cmds=""
210 # Create a temporary old-style archive to link instead of a shared archive.
211 old_archive_from_expsyms_cmds=""
213 # Commands used to build and install a shared archive.
214 archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
215 archive_expsym_cmds="\$echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
216 cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
217 \$echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
218 \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
220 postuninstall_cmds=""
222 # Commands used to build a loadable module (assumed same as above if empty)
224 module_expsym_cmds=""
226 # Commands to strip libraries.
227 old_striplib="strip --strip-debug"
228 striplib="strip --strip-unneeded"
230 # Dependencies to place before the objects being linked to create a
234 # Dependencies to place after the objects being linked to create a
238 # Dependencies to place before the objects being linked to create a
242 # Dependencies to place after the objects being linked to create a
246 # The library search path used internally by the compiler when linking
248 compiler_lib_search_path=""
250 # Method to check whether dependent libraries are shared objects.
251 deplibs_check_method="pass_all"
253 # Command to use when deplibs_check_method == file_magic.
254 file_magic_cmd="\$MAGIC_CMD"
256 # Flag that allows shared libraries with undefined symbols to be built.
257 allow_undefined_flag=""
259 # Flag that forces no undefined symbols.
262 # Commands used to finish a libtool library installation in a directory.
263 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
265 # Same as above, but a single script fragment to be evaled but not shown.
268 # Take the output of nm and produce a listing of raw symbols and C names.
269 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
271 # Transform the output of nm in a proper C declaration
272 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
274 # Transform the output of nm in a C name address pair
275 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
277 # This is the shared library runtime path variable.
278 runpath_var=LD_RUN_PATH
280 # This is the shared library path variable.
281 shlibpath_var=LD_LIBRARY_PATH
283 # Is shlibpath searched before the hard-coded library search path?
284 shlibpath_overrides_runpath=no
286 # How to hardcode a shared library path into an executable.
287 hardcode_action=immediate
289 # Whether we should hardcode library paths into libraries.
290 hardcode_into_libs=yes
292 # Flag to hardcode $libdir into a binary during linking.
293 # This must work even if $libdir does not exist.
294 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
296 # If ld is used when linking, flag to hardcode $libdir into
297 # a binary during linking. This must work even if $libdir does
299 hardcode_libdir_flag_spec_ld=""
301 # Whether we need a single -rpath flag with a separated argument.
302 hardcode_libdir_separator=""
304 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
308 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
312 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
313 # the resulting binary.
314 hardcode_shlibpath_var=unsupported
316 # Set to yes if building a shared library automatically hardcodes DIR into the library
317 # and all subsequent libraries and executables linked against it.
318 hardcode_automatic=no
320 # Variables whose values should be saved in libtool wrapper scripts and
321 # restored at relink time.
322 variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
324 # Whether libtool must link a program against all its dependency libraries.
327 # Compile-time system search path for libraries
328 sys_lib_search_path_spec=" /home/velho/usr/lib/i486-linux-gnu/4.1.2/ /home/velho/usr/lib/ ./i486-linux-gnu/4.1.2/ ./ /usr/lib/gcc/i486-linux-gnu/4.1.2/ /usr/lib/gcc/i486-linux-gnu/4.1.2/ /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../i486-linux-gnu/lib/i486-linux-gnu/4.1.2/ /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../i486-linux-gnu/lib/ /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../i486-linux-gnu/4.1.2/ /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../ /lib/i486-linux-gnu/4.1.2/ /lib/ /usr/lib/i486-linux-gnu/4.1.2/ /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/X11R6/lib /usr/lib/atlas "
333 # Fix the shell variable $srcfile for the compiler.
336 # Set to yes if exported symbols are required.
337 always_export_symbols=no
339 # The commands to list exported symbols.
340 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
342 # The commands to extract the exported symbol list from a shared archive.
343 extract_expsyms_cmds=""
345 # Symbols that should not be listed in the preloaded symbols.
346 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
348 # Symbols that must always be exported.
351 # ### END LIBTOOL CONFIG
353 # ltmain.sh - Provide generalized library-building support services.
354 # NOTE: Changing this file will not affect anything until you rerun configure.
356 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
357 # Free Software Foundation, Inc.
358 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
360 # This program is free software; you can redistribute it and/or modify
361 # it under the terms of the GNU General Public License as published by
362 # the Free Software Foundation; either version 2 of the License, or
363 # (at your option) any later version.
365 # This program is distributed in the hope that it will be useful, but
366 # WITHOUT ANY WARRANTY; without even the implied warranty of
367 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
368 # General Public License for more details.
370 # You should have received a copy of the GNU General Public License
371 # along with this program; if not, write to the Free Software
372 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
374 # As a special exception to the GNU General Public License, if you
375 # distribute this file as part of a program that contains a
376 # configuration script generated by Autoconf, you may include it under
377 # the same distribution terms that you use for the rest of that program.
381 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
382 # is ksh but when the shell is invoked as "sh" and the current value of
383 # the _XPG environment variable is not equal to 1 (one), the special
384 # positional parameter $0, within a function call, is the name of the
388 # The name of this program:
389 progname=`echo "$progpath" | $SED $basename`
398 VERSION="1.5.22 Debian 1.5.22-2"
399 TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
401 # See if we are running on zsh, and set the options which allow our
402 # commands through without removal of \ escapes.
403 if test -n "${ZSH_VERSION+set}" ; then
407 # Check that we have a working $echo.
408 if test "X$1" = X--no-reexec; then
409 # Discard the --no-reexec flag, and continue.
411 elif test "X$1" = X--fallback-echo; then
412 # Avoid inline document here, it may be left over
414 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
415 # Yippee, $echo works!
418 # Restart under the correct shell, and then maybe $echo will work.
419 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
422 if test "X$1" = X--fallback-echo; then
423 # used as fallback echo
432 help="Try \`$progname --help' for more information."
433 magic="%%%MAGIC variable%%%"
438 # Sed substitution that helps us do robust quoting. It backslashifies
439 # metacharacters that are still active within double-quoted strings.
440 Xsed="${SED}"' -e 1s/^X//'
441 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
442 # test EBCDIC or ASCII
443 case `echo X|tr X '\101'` in
444 A) # ASCII based system
445 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
447 NL2SP='tr \015\012 \040\040'
449 *) # EBCDIC based system
451 NL2SP='tr \r\n \100\100'
456 # Only set LANG and LC_ALL to C if already set.
457 # These must not be set unconditionally because not all systems understand
458 # e.g. LANG=C (notably SCO).
459 # We save the old values to restore during execute mode.
460 if test "${LC_ALL+set}" = set; then
461 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
463 if test "${LANG+set}" = set; then
464 save_LANG="$LANG"; LANG=C; export LANG
467 # Make sure IFS has a sensible default
472 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
473 $echo "$modename: not configured to build any kind of library" 1>&2
474 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
489 lo2o="s/\\.lo\$/.${objext}/"
490 o2lo="s/\\.${objext}\$/.lo/"
492 #####################################
493 # Shell function definitions:
494 # This seems to be the best place for them
496 # func_mktempdir [string]
497 # Make a temporary directory that won't clash with other running
498 # libtool processes, and avoids race conditions if possible. If
499 # given, STRING is the basename for that directory.
502 my_template="${TMPDIR-/tmp}/${1-$progname}"
504 if test "$run" = ":"; then
505 # Return a directory name, but don't create it in dry-run mode
506 my_tmpdir="${my_template}-$$"
509 # If mktemp works, use that first and foremost
510 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
512 if test ! -d "$my_tmpdir"; then
513 # Failing that, at least try and use $RANDOM to avoid a race
514 my_tmpdir="${my_template}-${RANDOM-0}$$"
516 save_mktempdir_umask=`umask`
519 umask $save_mktempdir_umask
522 # If we're not in dry-run mode, bomb out on failure
523 test -d "$my_tmpdir" || {
524 $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
529 $echo "X$my_tmpdir" | $Xsed
533 # func_win32_libid arg
534 # return the library type of file 'arg'
536 # Need a lot of goo to handle *both* DLLs and import libs
537 # Has to be a shell function in order to 'eat' the argument
538 # that is supplied when $file_magic_command is called.
541 win32_libid_type="unknown"
542 win32_fileres=`file -L $1 2>/dev/null`
543 case $win32_fileres in
544 *ar\ archive\ import\ library*) # definitely import
545 win32_libid_type="x86 archive import"
547 *ar\ archive*) # could be an import, or static
548 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
549 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
550 win32_nmres=`eval $NM -f posix -A $1 | \
551 $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
553 import*) win32_libid_type="x86 archive import";;
554 *) win32_libid_type="x86 archive static";;
559 win32_libid_type="x86 DLL"
561 *executable*) # but shell scripts are "executable" too...
562 case $win32_fileres in
563 *MS\ Windows\ PE\ Intel*)
564 win32_libid_type="x86 DLL"
569 $echo $win32_libid_type
574 # Infer tagged configuration to use if any are available and
575 # if one wasn't chosen via the "--tag" command line option.
576 # Only attempt this if the compiler in the base compile
577 # command doesn't match the default compiler.
578 # arg is usually of the form 'gcc ...'
581 if test -n "$available_tags" && test -z "$tagname"; then
585 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
589 CC_quoted="$CC_quoted $arg"
592 # Blanks in the command may have been stripped by the calling shell,
593 # but not from the CC environment variable when configure was run.
594 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
595 # Blanks at the start of $base_compile will cause this to fail
596 # if we don't check for them as well.
598 for z in $available_tags; do
599 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
600 # Evaluate the configuration.
601 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
604 # Double-quote args containing other shell metacharacters.
606 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
610 CC_quoted="$CC_quoted $arg"
613 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
614 # The compiler in the base compile command matches
615 # the one in the tagged configuration.
616 # Assume this is the tagged configuration we want.
623 # If $tagname still isn't set, then no tagged configuration
624 # was found and let the user know that the "--tag" command
625 # line option must be used.
626 if test -z "$tagname"; then
627 $echo "$modename: unable to infer tagged configuration"
628 $echo "$modename: specify a tag with \`--tag'" 1>&2
631 # $echo "$modename: using $tagname tagged configuration"
639 # func_extract_an_archive dir oldlib
640 func_extract_an_archive ()
642 f_ex_an_ar_dir="$1"; shift
643 f_ex_an_ar_oldlib="$1"
645 $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
646 $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
647 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
650 $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
655 # func_extract_archives gentop oldlib ...
656 func_extract_archives ()
658 my_gentop="$1"; shift
666 $show "${rm}r $my_gentop"
667 $run ${rm}r "$my_gentop"
668 $show "$mkdir $my_gentop"
669 $run $mkdir "$my_gentop"
671 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
675 for my_xlib in $my_oldlibs; do
676 # Extract the objects.
678 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
679 *) my_xabs=`pwd`"/$my_xlib" ;;
681 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
682 my_xdir="$my_gentop/$my_xlib"
684 $show "${rm}r $my_xdir"
685 $run ${rm}r "$my_xdir"
686 $show "$mkdir $my_xdir"
687 $run $mkdir "$my_xdir"
689 if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
694 $show "Extracting $my_xabs"
695 # Do not bother doing anything if just a dry run
696 if test -z "$run"; then
697 darwin_orig_dir=`pwd`
698 cd $my_xdir || exit $?
699 darwin_archive=$my_xabs
701 darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
702 darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
703 if test -n "$darwin_arches"; then
704 darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
706 $show "$darwin_base_archive has multiple architectures $darwin_arches"
707 for darwin_arch in $darwin_arches ; do
708 mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
709 lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
710 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
711 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
713 $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
714 done # $darwin_arches
715 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
716 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
719 for darwin_file in $darwin_filelist; do
720 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
721 lipo -create -output "$darwin_file" $darwin_files
722 done # $darwin_filelist
724 cd "$darwin_orig_dir"
726 cd "$darwin_orig_dir"
727 func_extract_an_archive "$my_xdir" "$my_xabs"
732 func_extract_an_archive "$my_xdir" "$my_xabs"
735 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
737 func_extract_archives_result="$my_oldobjs"
739 # End of Shell function definitions
740 #####################################
743 eval std_shrext=\"$shrext_cmds\"
747 # Parse our command line options once, thoroughly.
748 while test "$#" -gt 0
754 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
758 # If the previous option needs an argument, assign it.
759 if test -n "$prev"; then
762 execute_dlfiles="$execute_dlfiles $arg"
766 preserve_args="${preserve_args}=$arg"
768 # Check whether tagname contains only valid characters
771 $echo "$progname: invalid tag name: $tagname" 1>&2
778 # Don't test for the "default" C tag, as we know, it's there, but
779 # not specially marked.
782 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
783 taglist="$taglist $tagname"
784 # Evaluate the configuration.
785 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
787 $echo "$progname: ignoring unknown tag $tagname" 1>&2
802 # Have we seen a non-optional argument yet?
809 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
811 $echo "Copyright (C) 2005 Free Software Foundation, Inc."
812 $echo "This is free software; see the source for copying conditions. There is NO"
813 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
818 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
819 # Now print the configurations for the tags.
820 for tagname in $taglist; do
821 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
827 $echo "$progname: enabling shell trace mode"
829 preserve_args="$preserve_args $arg"
838 if test "$build_libtool_libs" = yes; then
839 $echo "enable shared libraries"
841 $echo "disable shared libraries"
843 if test "$build_old_libs" = yes; then
844 $echo "enable static libraries"
846 $echo "disable static libraries"
851 --finish) mode="finish" ;;
853 --mode) prevopt="--mode" prev=mode ;;
854 --mode=*) mode="$optarg" ;;
856 --preserve-dup-deps) duplicate_deps="yes" ;;
860 preserve_args="$preserve_args $arg"
866 preserve_args="$preserve_args --tag"
869 set tag "$optarg" ${1+"$@"}
872 preserve_args="$preserve_args --tag"
881 $echo "$modename: unrecognized option \`$arg'" 1>&2
893 if test -n "$prevopt"; then
894 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
899 case $disable_libs in
903 build_libtool_libs=no
907 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
911 # If this variable is set in any of the actions, the command in it
912 # will be execed at the end. This prevents here-documents from being
913 # left over by shells.
916 if test -z "$show_help"; then
918 # Infer the operation mode.
919 if test -z "$mode"; then
920 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
921 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
923 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
935 *db | *dbx | *strace | *truss)
945 # If we have no mode, but dlfiles were specified, then do execute mode.
946 test -n "$execute_dlfiles" && mode=execute
948 # Just use the default operation mode.
949 if test -z "$mode"; then
950 if test -n "$nonopt"; then
951 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
953 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
960 # Only execute mode is allowed to have -dlopen flags.
961 if test -n "$execute_dlfiles" && test "$mode" != execute; then
962 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
967 # Change the help message to a mode-specific one.
969 help="Try \`$modename --help --mode=$mode' for more information."
971 # These modes are in order of execution frequency so that they run quickly.
973 # libtool compile mode
975 modename="$modename: compile"
976 # Get the compilation command and the source file.
978 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
989 # do not "continue". Instead, add this to base_compile
1001 # Accept any command-line options.
1004 if test -n "$libobj" ; then
1005 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
1012 -static | -prefer-pic | -prefer-non-pic)
1023 arg_mode=arg # the next one goes into the "base_compile" arg list
1024 continue # The current "srcfile" will either be retained or
1025 ;; # replaced later. I would guess that would be a bug.
1028 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
1030 save_ifs="$IFS"; IFS=','
1031 for arg in $args; do
1034 # Double-quote args containing other shell metacharacters.
1035 # Many Bourne shells cannot handle close brackets correctly
1036 # in scan sets, so we specify it separately.
1038 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1042 lastarg="$lastarg $arg"
1045 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
1047 # Add the arguments to base_compile.
1048 base_compile="$base_compile $lastarg"
1053 # Accept the current argument as the source file.
1054 # The previous "srcfile" becomes the current argument.
1061 esac # case $arg_mode
1063 # Aesthetically quote the previous argument.
1064 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
1067 # Double-quote args containing other shell metacharacters.
1068 # Many Bourne shells cannot handle close brackets correctly
1069 # in scan sets, and some SunOS ksh mistreat backslash-escaping
1070 # in scan sets (worked around with variable expansion),
1071 # and furthermore cannot handle '|' '&' '(' ')' in scan sets
1072 # at all, so we specify them separately.
1073 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1074 lastarg="\"$lastarg\""
1078 base_compile="$base_compile $lastarg"
1083 $echo "$modename: you must specify an argument for -Xcompile"
1087 $echo "$modename: you must specify a target with \`-o'" 1>&2
1091 # Get the name of the library object.
1092 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
1096 # Recognize several different file suffixes.
1097 # If the user specifies -o file.o, it is replaced with file.lo
1107 *.class) xform=class ;;
1112 *.java) xform=java ;;
1115 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
1118 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
1120 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
1125 func_infer_tag $base_compile
1127 for arg in $later; do
1146 qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
1148 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1149 qlibobj="\"$qlibobj\"" ;;
1151 test "X$libobj" != "X$qlibobj" \
1152 && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
1153 && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
1154 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
1155 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
1156 if test "X$xdir" = "X$obj"; then
1161 lobj=${xdir}$objdir/$objname
1163 if test -z "$base_compile"; then
1164 $echo "$modename: you must specify a compilation command" 1>&2
1169 # Delete any leftover library objects.
1170 if test "$build_old_libs" = yes; then
1171 removelist="$obj $lobj $libobj ${libobj}T"
1173 removelist="$lobj $libobj ${libobj}T"
1176 $run $rm $removelist
1177 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1179 # On Cygwin there's no "real" PIC flag so we must build both object types
1181 cygwin* | mingw* | pw32* | os2*)
1185 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
1186 # non-PIC code in shared libraries is not supported
1190 # Calculate the filename of the output object if compiler does
1191 # not support -o with -c
1192 if test "$compiler_c_o" = no; then
1193 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
1194 lockfile="$output_obj.lock"
1195 removelist="$removelist $output_obj $lockfile"
1196 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1203 # Lock this critical section if it is needed
1204 # We use this script file to make the link, it avoids creating a new file
1205 if test "$need_locks" = yes; then
1206 until $run ln "$progpath" "$lockfile" 2>/dev/null; do
1207 $show "Waiting for $lockfile to be removed"
1210 elif test "$need_locks" = warn; then
1211 if test -f "$lockfile"; then
1213 *** ERROR, $lockfile exists and contains:
1214 `cat $lockfile 2>/dev/null`
1216 This indicates that another process is trying to use the same
1217 temporary object file, and libtool could not work around it because
1218 your compiler does not support \`-c' and \`-o' together. If you
1219 repeat this compilation, it may succeed, by chance, but you had better
1220 avoid parallel builds (make -j) in this platform, or get a better
1223 $run $rm $removelist
1226 $echo "$srcfile" > "$lockfile"
1229 if test -n "$fix_srcfile_path"; then
1230 eval srcfile=\"$fix_srcfile_path\"
1232 qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
1234 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1235 qsrcfile="\"$qsrcfile\"" ;;
1238 $run $rm "$libobj" "${libobj}T"
1240 # Create a libtool object file (analogous to a ".la" file),
1241 # but don't create it if we're doing a dry run.
1242 test -z "$run" && cat > ${libobj}T <<EOF
1243 # $libobj - a libtool object file
1244 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
1246 # Please DO NOT delete this file!
1247 # It is necessary for linking the library.
1249 # Name of the PIC object.
1252 # Only build a PIC object if we are building libtool libraries.
1253 if test "$build_libtool_libs" = yes; then
1254 # Without this assignment, base_compile gets emptied.
1255 fbsd_hideous_sh_bug=$base_compile
1257 if test "$pic_mode" != no; then
1258 command="$base_compile $qsrcfile $pic_flag"
1260 # Don't build PIC code
1261 command="$base_compile $qsrcfile"
1264 if test ! -d "${xdir}$objdir"; then
1265 $show "$mkdir ${xdir}$objdir"
1266 $run $mkdir ${xdir}$objdir
1268 if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
1273 if test -z "$output_obj"; then
1274 # Place PIC objects in $objdir
1275 command="$command -o $lobj"
1278 $run $rm "$lobj" "$output_obj"
1281 if $run eval "$command"; then :
1283 test -n "$output_obj" && $run $rm $removelist
1287 if test "$need_locks" = warn &&
1288 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1290 *** ERROR, $lockfile contains:
1291 `cat $lockfile 2>/dev/null`
1293 but it should contain:
1296 This indicates that another process is trying to use the same
1297 temporary object file, and libtool could not work around it because
1298 your compiler does not support \`-c' and \`-o' together. If you
1299 repeat this compilation, it may succeed, by chance, but you had better
1300 avoid parallel builds (make -j) in this platform, or get a better
1303 $run $rm $removelist
1307 # Just move the object if needed, then go on to compile the next one
1308 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1309 $show "$mv $output_obj $lobj"
1310 if $run $mv $output_obj $lobj; then :
1313 $run $rm $removelist
1318 # Append the name of the PIC object to the libtool object file.
1319 test -z "$run" && cat >> ${libobj}T <<EOF
1320 pic_object='$objdir/$objname'
1324 # Allow error messages only from the first compilation.
1325 if test "$suppress_opt" = yes; then
1326 suppress_output=' >/dev/null 2>&1'
1329 # No PIC object so indicate it doesn't exist in the libtool
1331 test -z "$run" && cat >> ${libobj}T <<EOF
1337 # Only build a position-dependent object if we build old libraries.
1338 if test "$build_old_libs" = yes; then
1339 if test "$pic_mode" != yes; then
1340 # Don't build PIC code
1341 command="$base_compile $qsrcfile"
1343 command="$base_compile $qsrcfile $pic_flag"
1345 if test "$compiler_c_o" = yes; then
1346 command="$command -o $obj"
1349 # Suppress compiler output if we already did a PIC compilation.
1350 command="$command$suppress_output"
1351 $run $rm "$obj" "$output_obj"
1353 if $run eval "$command"; then :
1355 $run $rm $removelist
1359 if test "$need_locks" = warn &&
1360 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1362 *** ERROR, $lockfile contains:
1363 `cat $lockfile 2>/dev/null`
1365 but it should contain:
1368 This indicates that another process is trying to use the same
1369 temporary object file, and libtool could not work around it because
1370 your compiler does not support \`-c' and \`-o' together. If you
1371 repeat this compilation, it may succeed, by chance, but you had better
1372 avoid parallel builds (make -j) in this platform, or get a better
1375 $run $rm $removelist
1379 # Just move the object if needed
1380 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1381 $show "$mv $output_obj $obj"
1382 if $run $mv $output_obj $obj; then :
1385 $run $rm $removelist
1390 # Append the name of the non-PIC object the libtool object file.
1391 # Only append if the libtool object file exists.
1392 test -z "$run" && cat >> ${libobj}T <<EOF
1393 # Name of the non-PIC object.
1394 non_pic_object='$objname'
1398 # Append the name of the non-PIC object the libtool object file.
1399 # Only append if the libtool object file exists.
1400 test -z "$run" && cat >> ${libobj}T <<EOF
1401 # Name of the non-PIC object.
1407 $run $mv "${libobj}T" "${libobj}"
1409 # Unlock the critical section if it was locked
1410 if test "$need_locks" != no; then
1411 $run $rm "$lockfile"
1419 modename="$modename: link"
1421 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1422 # It is impossible to link a dll without this setting, and
1423 # we shouldn't force the makefile maintainer to figure out
1424 # which system we are compiling for in order to pass an extra
1425 # flag for every libtool invocation.
1426 # allow_undefined=no
1428 # FIXME: Unfortunately, there are problems with the above when trying
1429 # to make a dll which has undefined symbols, in which case not
1430 # even a static library is built. For now, we need to specify
1431 # -no-undefined on the libtool link line when we can be certain
1432 # that all symbols are satisfied, otherwise we get a static library.
1439 libtool_args="$nonopt"
1440 base_compile="$nonopt $@"
1441 compile_command="$nonopt"
1442 finalize_command="$nonopt"
1455 lib_search_path=`pwd`
1464 export_symbols_regex=
1472 notinst_path= # paths that contain not-installed libtool libraries
1473 precious_files_regex=
1474 prefer_static_libs=no
1487 func_infer_tag $base_compile
1489 # We need to know -static, to get the right output filenames.
1493 -all-static | -static)
1494 if test "X$arg" = "X-all-static"; then
1495 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1496 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1498 if test -n "$link_static_flag"; then
1499 dlopen_self=$dlopen_self_static
1501 prefer_static_libs=yes
1503 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1504 dlopen_self=$dlopen_self_static
1506 prefer_static_libs=built
1508 build_libtool_libs=no
1515 # See if our shared archives depend on static archives.
1516 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1518 # Go through the arguments, transforming them on the way.
1519 while test "$#" -gt 0; do
1523 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1524 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1528 libtool_args="$libtool_args $qarg"
1530 # If the previous option needs an argument, assign it.
1531 if test -n "$prev"; then
1534 compile_command="$compile_command @OUTPUT@"
1535 finalize_command="$finalize_command @OUTPUT@"
1541 if test "$preload" = no; then
1542 # Add the symbol object into the linking commands.
1543 compile_command="$compile_command @SYMFILE@"
1544 finalize_command="$finalize_command @SYMFILE@"
1548 *.la | *.lo) ;; # We handle these cases below.
1550 if test "$dlself" = no; then
1558 if test "$prev" = dlprefiles; then
1560 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1570 if test "$prev" = dlfiles; then
1571 dlfiles="$dlfiles $arg"
1573 dlprefiles="$dlprefiles $arg"
1581 export_symbols="$arg"
1582 if test ! -f "$arg"; then
1583 $echo "$modename: symbol file \`$arg' does not exist"
1590 export_symbols_regex="$arg"
1595 inst_prefix_dir="$arg"
1600 precious_files_regex="$arg"
1610 if test -f "$arg"; then
1613 for fil in `cat $save_arg`
1615 # moreargs="$moreargs $fil"
1617 # A libtool-controlled object.
1619 # Check to see that this really is a libtool object.
1620 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1625 # If there is no directory component, then add one.
1627 */* | *\\*) . $arg ;;
1631 if test -z "$pic_object" || \
1632 test -z "$non_pic_object" ||
1633 test "$pic_object" = none && \
1634 test "$non_pic_object" = none; then
1635 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1639 # Extract subdirectory from the argument.
1640 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1641 if test "X$xdir" = "X$arg"; then
1647 if test "$pic_object" != none; then
1648 # Prepend the subdirectory the object is found in.
1649 pic_object="$xdir$pic_object"
1651 if test "$prev" = dlfiles; then
1652 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1653 dlfiles="$dlfiles $pic_object"
1657 # If libtool objects are unsupported, then we need to preload.
1662 # CHECK ME: I think I busted this. -Ossama
1663 if test "$prev" = dlprefiles; then
1664 # Preload the old-style object.
1665 dlprefiles="$dlprefiles $pic_object"
1670 libobjs="$libobjs $pic_object"
1675 if test "$non_pic_object" != none; then
1676 # Prepend the subdirectory the object is found in.
1677 non_pic_object="$xdir$non_pic_object"
1679 # A standard non-PIC object
1680 non_pic_objects="$non_pic_objects $non_pic_object"
1681 if test -z "$pic_object" || test "$pic_object" = none ; then
1682 arg="$non_pic_object"
1685 # If the PIC object exists, use it instead.
1686 # $xdir was prepended to $pic_object above.
1687 non_pic_object="$pic_object"
1688 non_pic_objects="$non_pic_objects $non_pic_object"
1691 # Only an error if not doing a dry-run.
1692 if test -z "$run"; then
1693 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1698 # Extract subdirectory from the argument.
1699 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1700 if test "X$xdir" = "X$arg"; then
1706 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1707 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1708 libobjs="$libobjs $pic_object"
1709 non_pic_objects="$non_pic_objects $non_pic_object"
1714 $echo "$modename: link input file \`$save_arg' does not exist"
1722 # We need an absolute path.
1724 [\\/]* | [A-Za-z]:[\\/]*) ;;
1726 $echo "$modename: only absolute run-paths are allowed" 1>&2
1730 if test "$prev" = rpath; then
1733 *) rpath="$rpath $arg" ;;
1738 *) xrpath="$xrpath $arg" ;;
1745 compiler_flags="$compiler_flags $qarg"
1747 compile_command="$compile_command $qarg"
1748 finalize_command="$finalize_command $qarg"
1752 linker_flags="$linker_flags $qarg"
1753 compiler_flags="$compiler_flags $wl$qarg"
1755 compile_command="$compile_command $wl$qarg"
1756 finalize_command="$finalize_command $wl$qarg"
1760 linker_flags="$linker_flags $qarg"
1761 compiler_flags="$compiler_flags $qarg"
1763 compile_command="$compile_command $qarg"
1764 finalize_command="$finalize_command $qarg"
1772 darwin_framework|darwin_framework_skip)
1773 test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
1774 compile_command="$compile_command $arg"
1775 finalize_command="$finalize_command $arg"
1780 eval "$prev=\"\$arg\""
1785 fi # test -n "$prev"
1791 if test -n "$link_static_flag"; then
1792 compile_command="$compile_command $link_static_flag"
1793 finalize_command="$finalize_command $link_static_flag"
1799 # FIXME: remove this flag sometime in the future.
1800 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1824 -export-symbols | -export-symbols-regex)
1825 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1826 $echo "$modename: more than one -exported-symbols argument is not allowed"
1829 if test "X$arg" = "X-export-symbols"; then
1837 -framework|-arch|-isysroot)
1839 *" ${arg} ${1} "* | *" ${arg} ${1} "*)
1840 prev=darwin_framework_skip ;;
1841 *) compiler_flags="$compiler_flags $arg"
1842 prev=darwin_framework ;;
1844 compile_command="$compile_command $arg"
1845 finalize_command="$finalize_command $arg"
1854 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1855 # so, if we see these flags be careful not to treat them like -L
1857 case $with_gcc/$host in
1858 no/*-*-irix* | /*-*-irix*)
1859 compile_command="$compile_command $arg"
1860 finalize_command="$finalize_command $arg"
1867 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1868 # We need an absolute path.
1870 [\\/]* | [A-Za-z]:[\\/]*) ;;
1872 absdir=`cd "$dir" && pwd`
1873 if test -z "$absdir"; then
1874 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1876 notinst_path="$notinst_path $dir"
1884 deplibs="$deplibs -L$dir"
1885 lib_search_path="$lib_search_path $dir"
1889 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1890 testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1891 case :$dllsearchpath: in
1893 *) dllsearchpath="$dllsearchpath:$dir";;
1895 case :$dllsearchpath: in
1896 *":$testbindir:"*) ;;
1897 *) dllsearchpath="$dllsearchpath:$testbindir";;
1905 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1907 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
1908 # These systems don't actually have a C or math library (as such)
1912 # These systems don't actually have a C library (as such)
1913 test "X$arg" = "X-lc" && continue
1915 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1916 # Do not include libc due to us having libc/libc_r.
1917 test "X$arg" = "X-lc" && continue
1919 *-*-rhapsody* | *-*-darwin1.[012])
1920 # Rhapsody C and math libraries are in the System framework
1921 deplibs="$deplibs -framework System"
1924 *-*-sco3.2v5* | *-*-sco5v6*)
1925 # Causes problems with __ctype
1926 test "X$arg" = "X-lc" && continue
1928 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
1929 # Compiler inserts libc in the correct place for threads to work
1930 test "X$arg" = "X-lc" && continue
1933 elif test "X$arg" = "X-lc_r"; then
1935 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1936 # Do not include libc_r directly, use -pthread flag.
1941 deplibs="$deplibs $arg"
1945 # Tru64 UNIX uses -model [arg] to determine the layout of C++
1946 # classes, name mangling, and exception handling.
1948 compile_command="$compile_command $arg"
1949 compiler_flags="$compiler_flags $arg"
1950 finalize_command="$finalize_command $arg"
1955 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1956 compiler_flags="$compiler_flags $arg"
1957 compile_command="$compile_command $arg"
1958 finalize_command="$finalize_command $arg"
1967 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
1968 # -r[0-9][0-9]* specifies the processor on the SGI compiler
1969 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
1970 # +DA*, +DD* enable 64-bit mode on the HP compiler
1971 # -q* pass through compiler args for the IBM compiler
1972 # -m* pass through architecture-specific compiler args for GCC
1973 # -m*, -t[45]*, -txscale* pass through architecture-specific
1974 # compiler args for GCC
1975 # -pg pass through profiling flag for GCC
1976 # @file GCC response files
1977 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \
1978 -t[45]*|-txscale*|@*)
1980 # Unknown arguments in both finalize_command and compile_command need
1981 # to be aesthetically quoted because they are evaled later.
1982 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1984 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1988 compile_command="$compile_command $arg"
1989 finalize_command="$finalize_command $arg"
1990 compiler_flags="$compiler_flags $arg"
2006 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
2007 # The PATH hackery in wrapper scripts is required on Windows
2008 # in order for the loader to find any dlls it needs.
2009 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
2010 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
2013 *) no_install=yes ;;
2030 -precious-files-regex)
2051 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
2052 # We need an absolute path.
2054 [\\/]* | [A-Za-z]:[\\/]*) ;;
2056 $echo "$modename: only absolute run-paths are allowed" 1>&2
2062 *) xrpath="$xrpath $dir" ;;
2068 # The effects of -static are defined in a previous loop.
2069 # We used to do the same as -all-static on platforms that
2070 # didn't have a PIC flag, but the assumption that the effects
2071 # would be equivalent was wrong. It would break on at least
2072 # Digital Unix and AIX.
2092 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
2094 save_ifs="$IFS"; IFS=','
2095 for flag in $args; do
2098 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2103 compiler_flags="$compiler_flags $flag"
2106 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
2110 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
2112 save_ifs="$IFS"; IFS=','
2113 for flag in $args; do
2116 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2121 compiler_flags="$compiler_flags $wl$flag"
2122 linker_flags="$linker_flags $flag"
2125 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
2143 # Some other compiler flag.
2145 # Unknown arguments in both finalize_command and compile_command need
2146 # to be aesthetically quoted because they are evaled later.
2147 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2149 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2156 # A standard object.
2161 # A libtool-controlled object.
2163 # Check to see that this really is a libtool object.
2164 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2169 # If there is no directory component, then add one.
2171 */* | *\\*) . $arg ;;
2175 if test -z "$pic_object" || \
2176 test -z "$non_pic_object" ||
2177 test "$pic_object" = none && \
2178 test "$non_pic_object" = none; then
2179 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
2183 # Extract subdirectory from the argument.
2184 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2185 if test "X$xdir" = "X$arg"; then
2191 if test "$pic_object" != none; then
2192 # Prepend the subdirectory the object is found in.
2193 pic_object="$xdir$pic_object"
2195 if test "$prev" = dlfiles; then
2196 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
2197 dlfiles="$dlfiles $pic_object"
2201 # If libtool objects are unsupported, then we need to preload.
2206 # CHECK ME: I think I busted this. -Ossama
2207 if test "$prev" = dlprefiles; then
2208 # Preload the old-style object.
2209 dlprefiles="$dlprefiles $pic_object"
2214 libobjs="$libobjs $pic_object"
2219 if test "$non_pic_object" != none; then
2220 # Prepend the subdirectory the object is found in.
2221 non_pic_object="$xdir$non_pic_object"
2223 # A standard non-PIC object
2224 non_pic_objects="$non_pic_objects $non_pic_object"
2225 if test -z "$pic_object" || test "$pic_object" = none ; then
2226 arg="$non_pic_object"
2229 # If the PIC object exists, use it instead.
2230 # $xdir was prepended to $pic_object above.
2231 non_pic_object="$pic_object"
2232 non_pic_objects="$non_pic_objects $non_pic_object"
2235 # Only an error if not doing a dry-run.
2236 if test -z "$run"; then
2237 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
2242 # Extract subdirectory from the argument.
2243 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2244 if test "X$xdir" = "X$arg"; then
2250 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
2251 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
2252 libobjs="$libobjs $pic_object"
2253 non_pic_objects="$non_pic_objects $non_pic_object"
2260 deplibs="$deplibs $arg"
2261 old_deplibs="$old_deplibs $arg"
2266 # A libtool-controlled library.
2268 if test "$prev" = dlfiles; then
2269 # This library was specified with -dlopen.
2270 dlfiles="$dlfiles $arg"
2272 elif test "$prev" = dlprefiles; then
2273 # The library was specified with -dlpreopen.
2274 dlprefiles="$dlprefiles $arg"
2277 deplibs="$deplibs $arg"
2282 # Some other compiler argument.
2284 # Unknown arguments in both finalize_command and compile_command need
2285 # to be aesthetically quoted because they are evaled later.
2286 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2288 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2295 # Now actually substitute the argument into the commands.
2296 if test -n "$arg"; then
2297 compile_command="$compile_command $arg"
2298 finalize_command="$finalize_command $arg"
2300 done # argument parsing loop
2302 if test -n "$prev"; then
2303 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
2308 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
2309 eval arg=\"$export_dynamic_flag_spec\"
2310 compile_command="$compile_command $arg"
2311 finalize_command="$finalize_command $arg"
2315 # calculate the name of the file, without its directory
2316 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
2317 libobjs_save="$libobjs"
2319 if test -n "$shlibpath_var"; then
2320 # get the directories listed in $shlibpath_var
2321 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2325 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
2326 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
2328 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2329 if test "X$output_objdir" = "X$output"; then
2330 output_objdir="$objdir"
2332 output_objdir="$output_objdir/$objdir"
2334 # Create the object directory.
2335 if test ! -d "$output_objdir"; then
2336 $show "$mkdir $output_objdir"
2337 $run $mkdir $output_objdir
2339 if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
2344 # Determine the type of output
2347 $echo "$modename: you must specify an output file" 1>&2
2351 *.$libext) linkmode=oldlib ;;
2352 *.lo | *.$objext) linkmode=obj ;;
2353 *.la) linkmode=lib ;;
2354 *) linkmode=prog ;; # Anything else should be a program.
2358 *cygwin* | *mingw* | *pw32*)
2359 # don't eliminate duplications in $postdeps and $predeps
2360 duplicate_compiler_generated_deps=yes
2363 duplicate_compiler_generated_deps=$duplicate_deps
2369 # Find all interdependent deplibs by searching for libraries
2370 # that are linked more than once (e.g. -la -lb -la)
2371 for deplib in $deplibs; do
2372 if test "X$duplicate_deps" = "Xyes" ; then
2374 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2377 libs="$libs $deplib"
2380 if test "$linkmode" = lib; then
2381 libs="$predeps $libs $compiler_lib_search_path $postdeps"
2383 # Compute libraries that are listed more than once in $predeps
2384 # $postdeps and mark them as special (i.e., whose duplicates are
2385 # not to be eliminated).
2387 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2388 for pre_post_dep in $predeps $postdeps; do
2389 case "$pre_post_deps " in
2390 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
2392 pre_post_deps="$pre_post_deps $pre_post_dep"
2401 need_relink=no # whether we're linking any uninstalled libtool libraries
2402 notinst_deplibs= # not-installed libtool libraries
2406 for file in $dlfiles $dlprefiles; do
2410 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2422 passes="conv scan dlopen dlpreopen link"
2427 for pass in $passes; do
2428 if test "$linkmode,$pass" = "lib,link" ||
2429 test "$linkmode,$pass" = "prog,scan"; then
2433 if test "$linkmode" = prog; then
2435 dlopen) libs="$dlfiles" ;;
2436 dlpreopen) libs="$dlprefiles" ;;
2438 libs="$deplibs %DEPLIBS%"
2439 test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
2443 if test "$pass" = dlopen; then
2444 # Collect dlpreopened libraries
2445 save_deplibs="$deplibs"
2448 for deplib in $libs; do
2452 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
2453 if test "$linkmode,$pass" = "prog,link"; then
2454 compile_deplibs="$deplib $compile_deplibs"
2455 finalize_deplibs="$deplib $finalize_deplibs"
2457 compiler_flags="$compiler_flags $deplib"
2462 if test "$linkmode" != lib && test "$linkmode" != prog; then
2463 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2466 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2467 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2468 for search_ext in .la $std_shrext .so .a; do
2469 # Search the libtool library
2470 lib="$searchdir/lib${name}${search_ext}"
2471 if test -f "$lib"; then
2472 if test "$search_ext" = ".la"; then
2481 if test "$found" != yes; then
2482 # deplib doesn't seem to be a libtool library
2483 if test "$linkmode,$pass" = "prog,link"; then
2484 compile_deplibs="$deplib $compile_deplibs"
2485 finalize_deplibs="$deplib $finalize_deplibs"
2487 deplibs="$deplib $deplibs"
2488 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2491 else # deplib is a libtool library
2492 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2493 # We need to do some special things here, and not later.
2494 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2495 case " $predeps $postdeps " in
2497 if (${SED} -e '2q' $lib |
2498 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2502 */* | *\\*) . $lib ;;
2505 for l in $old_library $library_names; do
2508 if test "X$ll" = "X$old_library" ; then # only static version available
2510 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2511 test "X$ladir" = "X$lib" && ladir="."
2512 lib=$ladir/$old_library
2513 if test "$linkmode,$pass" = "prog,link"; then
2514 compile_deplibs="$deplib $compile_deplibs"
2515 finalize_deplibs="$deplib $finalize_deplibs"
2517 deplibs="$deplib $deplibs"
2518 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2532 deplibs="$deplib $deplibs"
2533 test "$pass" = conv && continue
2534 newdependency_libs="$deplib $newdependency_libs"
2535 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2538 if test "$pass" = conv; then
2539 deplibs="$deplib $deplibs"
2542 if test "$pass" = scan; then
2543 deplibs="$deplib $deplibs"
2545 compile_deplibs="$deplib $compile_deplibs"
2546 finalize_deplibs="$deplib $finalize_deplibs"
2548 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2551 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2557 if test "$pass" = link; then
2558 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2559 # Make sure the xrpath contains only unique directories.
2562 *) xrpath="$xrpath $dir" ;;
2565 deplibs="$deplib $deplibs"
2568 *.la) lib="$deplib" ;;
2570 if test "$pass" = conv; then
2571 deplibs="$deplib $deplibs"
2577 case $deplibs_check_method in
2579 set dummy $deplibs_check_method
2580 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2581 if eval $echo \"$deplib\" 2>/dev/null \
2583 | $EGREP "$match_pattern_regex" > /dev/null; then
2591 if test "$valid_a_lib" != yes; then
2593 $echo "*** Warning: Trying to link with static lib archive $deplib."
2594 $echo "*** I have the capability to make that library automatically link in when"
2595 $echo "*** you link to this library. But I can only do this if you have a"
2596 $echo "*** shared version of the library, which you do not appear to have"
2597 $echo "*** because the file extensions .$libext of this argument makes me believe"
2598 $echo "*** that it is just a static archive that I should not used here."
2601 $echo "*** Warning: Linking the shared library $output against the"
2602 $echo "*** static library $deplib is not portable!"
2603 deplibs="$deplib $deplibs"
2608 if test "$pass" != link; then
2609 deplibs="$deplib $deplibs"
2611 compile_deplibs="$deplib $compile_deplibs"
2612 finalize_deplibs="$deplib $finalize_deplibs"
2619 if test "$pass" = conv; then
2620 deplibs="$deplib $deplibs"
2621 elif test "$linkmode" = prog; then
2622 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2623 # If there is no dlopen support or we're linking statically,
2624 # we need to preload.
2625 newdlprefiles="$newdlprefiles $deplib"
2626 compile_deplibs="$deplib $compile_deplibs"
2627 finalize_deplibs="$deplib $finalize_deplibs"
2629 newdlfiles="$newdlfiles $deplib"
2639 if test "$found" = yes || test -f "$lib"; then :
2641 $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
2645 # Check to see that this really is a libtool archive.
2646 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2648 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2652 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2653 test "X$ladir" = "X$lib" && ladir="."
2661 # If the library was installed with an old release of libtool,
2662 # it will not redefine variables installed, or shouldnotlink
2670 */* | *\\*) . $lib ;;
2674 if test "$linkmode,$pass" = "lib,link" ||
2675 test "$linkmode,$pass" = "prog,scan" ||
2676 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2677 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2678 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2681 if test "$pass" = conv; then
2682 # Only check for convenience libraries
2683 deplibs="$lib $deplibs"
2684 if test -z "$libdir"; then
2685 if test -z "$old_library"; then
2686 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2689 # It is a libtool convenience library, so add in its objects.
2690 convenience="$convenience $ladir/$objdir/$old_library"
2691 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2693 for deplib in $dependency_libs; do
2694 deplibs="$deplib $deplibs"
2695 if test "X$duplicate_deps" = "Xyes" ; then
2696 case "$tmp_libs " in
2697 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2700 tmp_libs="$tmp_libs $deplib"
2702 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2703 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2710 # Get the name of the library we link against.
2712 for l in $old_library $library_names; do
2715 if test -z "$linklib"; then
2716 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2720 # This library was specified with -dlopen.
2721 if test "$pass" = dlopen; then
2722 if test -z "$libdir"; then
2723 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2726 if test -z "$dlname" ||
2727 test "$dlopen_support" != yes ||
2728 test "$build_libtool_libs" = no; then
2729 # If there is no dlname, no dlopen support or we're linking
2730 # statically, we need to preload. We also need to preload any
2731 # dependent libraries so libltdl's deplib preloader doesn't
2732 # bomb out in the load deplibs phase.
2733 dlprefiles="$dlprefiles $lib $dependency_libs"
2735 newdlfiles="$newdlfiles $lib"
2740 # We need an absolute path.
2742 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2744 abs_ladir=`cd "$ladir" && pwd`
2745 if test -z "$abs_ladir"; then
2746 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2747 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2752 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2754 # Find the relevant object directory and library name.
2755 if test "X$installed" = Xyes; then
2756 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2757 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2765 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2767 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2770 # Remove this search path later
2771 notinst_path="$notinst_path $abs_ladir"
2773 dir="$ladir/$objdir"
2774 absdir="$abs_ladir/$objdir"
2775 # Remove this search path later
2776 notinst_path="$notinst_path $abs_ladir"
2778 fi # $installed = yes
2779 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2781 # This library was specified with -dlpreopen.
2782 if test "$pass" = dlpreopen; then
2783 if test -z "$libdir"; then
2784 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2787 # Prefer using a static library (so that no silly _DYNAMIC symbols
2788 # are required to link).
2789 if test -n "$old_library"; then
2790 newdlprefiles="$newdlprefiles $dir/$old_library"
2791 # Otherwise, use the dlname, so that lt_dlopen finds it.
2792 elif test -n "$dlname"; then
2793 newdlprefiles="$newdlprefiles $dir/$dlname"
2795 newdlprefiles="$newdlprefiles $dir/$linklib"
2797 fi # $pass = dlpreopen
2799 if test -z "$libdir"; then
2800 # Link the convenience library
2801 if test "$linkmode" = lib; then
2802 deplibs="$dir/$old_library $deplibs"
2803 elif test "$linkmode,$pass" = "prog,link"; then
2804 compile_deplibs="$dir/$old_library $compile_deplibs"
2805 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2807 deplibs="$lib $deplibs" # used for prog,scan pass
2813 if test "$linkmode" = prog && test "$pass" != link; then
2814 newlib_search_path="$newlib_search_path $ladir"
2815 deplibs="$lib $deplibs"
2818 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2819 test "$build_libtool_libs" = no; then
2824 for deplib in $dependency_libs; do
2826 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2828 # Need to link against all dependency_libs?
2829 if test "$linkalldeplibs" = yes; then
2830 deplibs="$deplib $deplibs"
2832 # Need to hardcode shared library paths
2833 # or/and link against static libraries
2834 newdependency_libs="$deplib $newdependency_libs"
2836 if test "X$duplicate_deps" = "Xyes" ; then
2837 case "$tmp_libs " in
2838 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2841 tmp_libs="$tmp_libs $deplib"
2844 fi # $linkmode = prog...
2846 if test "$linkmode,$pass" = "prog,link"; then
2847 if test -n "$library_names" &&
2848 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2849 # We need to hardcode the library path
2850 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2851 # Make sure the rpath contains only unique directories.
2852 case "$temp_rpath " in
2855 *) temp_rpath="$temp_rpath $absdir" ;;
2859 # Hardcode the library path.
2860 # Skip directories that are in the system default run-time
2862 case " $sys_lib_dlsearch_path " in
2865 case "$compile_rpath " in
2867 *) compile_rpath="$compile_rpath $absdir"
2871 case " $sys_lib_dlsearch_path " in
2874 case "$finalize_rpath " in
2876 *) finalize_rpath="$finalize_rpath $libdir"
2880 fi # $linkmode,$pass = prog,link...
2882 if test "$alldeplibs" = yes &&
2883 { test "$deplibs_check_method" = pass_all ||
2884 { test "$build_libtool_libs" = yes &&
2885 test -n "$library_names"; }; }; then
2886 # We only need to search for static libraries
2891 link_static=no # Whether the deplib will be linked statically
2892 use_static_libs=$prefer_static_libs
2893 if test "$use_static_libs" = built && test "$installed" = yes ; then
2896 if test -n "$library_names" &&
2897 { test "$use_static_libs" = no || test -z "$old_library"; }; then
2898 if test "$installed" = no; then
2899 notinst_deplibs="$notinst_deplibs $lib"
2902 # This is a shared library
2904 # Warn about portability, can't link against -module's on
2905 # some systems (darwin)
2906 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2908 if test "$linkmode" = prog; then
2909 $echo "*** Warning: Linking the executable $output against the loadable module"
2911 $echo "*** Warning: Linking the shared library $output against the loadable module"
2913 $echo "*** $linklib is not portable!"
2915 if test "$linkmode" = lib &&
2916 test "$hardcode_into_libs" = yes; then
2917 # Hardcode the library path.
2918 # Skip directories that are in the system default run-time
2920 case " $sys_lib_dlsearch_path " in
2923 case "$compile_rpath " in
2925 *) compile_rpath="$compile_rpath $absdir"
2929 case " $sys_lib_dlsearch_path " in
2932 case "$finalize_rpath " in
2934 *) finalize_rpath="$finalize_rpath $libdir"
2940 if test -n "$old_archive_from_expsyms_cmds"; then
2941 # figure out the soname
2942 set dummy $library_names
2945 libname=`eval \\$echo \"$libname_spec\"`
2946 # use dlname if we got it. it's perfectly good, no?
2947 if test -n "$dlname"; then
2949 elif test -n "$soname_spec"; then
2953 major=`expr $current - $age`
2957 eval soname=\"$soname_spec\"
2962 # Make a new name for the extract_expsyms_cmds to use
2964 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2965 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2967 # If the library has no export list, then create one now
2968 if test -f "$output_objdir/$soname-def"; then :
2970 $show "extracting exported symbol list from \`$soname'"
2971 save_ifs="$IFS"; IFS='~'
2972 cmds=$extract_expsyms_cmds
2973 for cmd in $cmds; do
2977 $run eval "$cmd" || exit $?
2983 if test -f "$output_objdir/$newlib"; then :; else
2984 $show "generating import library for \`$soname'"
2985 save_ifs="$IFS"; IFS='~'
2986 cmds=$old_archive_from_expsyms_cmds
2987 for cmd in $cmds; do
2991 $run eval "$cmd" || exit $?
2995 # make sure the library variables are pointing to the new library
2998 fi # test -n "$old_archive_from_expsyms_cmds"
3000 if test "$linkmode" = prog || test "$mode" != relink; then
3005 case $hardcode_action in
3006 immediate | unsupported)
3007 if test "$hardcode_direct" = no; then
3010 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
3011 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
3012 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
3013 *-*-unixware7*) add_dir="-L$dir" ;;
3015 # if the lib is a module then we can not link against
3016 # it, someone is ignoring the new warnings I added
3017 if /usr/bin/file -L $add 2> /dev/null |
3018 $EGREP ": [^:]* bundle" >/dev/null ; then
3019 $echo "** Warning, lib $linklib is a module, not a shared library"
3020 if test -z "$old_library" ; then
3022 $echo "** And there doesn't seem to be a static archive available"
3023 $echo "** The link will probably fail, sorry"
3025 add="$dir/$old_library"
3029 elif test "$hardcode_minus_L" = no; then
3031 *-*-sunos*) add_shlibpath="$dir" ;;
3035 elif test "$hardcode_shlibpath_var" = no; then
3036 add_shlibpath="$dir"
3043 if test "$hardcode_direct" = yes; then
3045 elif test "$hardcode_minus_L" = yes; then
3047 # Try looking first in the location we're being installed to.
3048 if test -n "$inst_prefix_dir"; then
3051 add_dir="$add_dir -L$inst_prefix_dir$libdir"
3056 elif test "$hardcode_shlibpath_var" = yes; then
3057 add_shlibpath="$dir"
3066 if test "$lib_linked" != yes; then
3067 $echo "$modename: configuration error: unsupported hardcode properties"
3071 if test -n "$add_shlibpath"; then
3072 case :$compile_shlibpath: in
3073 *":$add_shlibpath:"*) ;;
3074 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
3077 if test "$linkmode" = prog; then
3078 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
3079 test -n "$add" && compile_deplibs="$add $compile_deplibs"
3081 test -n "$add_dir" && deplibs="$add_dir $deplibs"
3082 test -n "$add" && deplibs="$add $deplibs"
3083 if test "$hardcode_direct" != yes && \
3084 test "$hardcode_minus_L" != yes && \
3085 test "$hardcode_shlibpath_var" = yes; then
3086 case :$finalize_shlibpath: in
3088 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
3094 if test "$linkmode" = prog || test "$mode" = relink; then
3098 # Finalize command for both is simple: just hardcode it.
3099 if test "$hardcode_direct" = yes; then
3100 add="$libdir/$linklib"
3101 elif test "$hardcode_minus_L" = yes; then
3104 elif test "$hardcode_shlibpath_var" = yes; then
3105 case :$finalize_shlibpath: in
3107 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
3110 elif test "$hardcode_automatic" = yes; then
3111 if test -n "$inst_prefix_dir" &&
3112 test -f "$inst_prefix_dir$libdir/$linklib" ; then
3113 add="$inst_prefix_dir$libdir/$linklib"
3115 add="$libdir/$linklib"
3118 # We cannot seem to hardcode it, guess we'll fake it.
3120 # Try looking first in the location we're being installed to.
3121 if test -n "$inst_prefix_dir"; then
3124 add_dir="$add_dir -L$inst_prefix_dir$libdir"
3131 if test "$linkmode" = prog; then
3132 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
3133 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
3135 test -n "$add_dir" && deplibs="$add_dir $deplibs"
3136 test -n "$add" && deplibs="$add $deplibs"
3139 elif test "$linkmode" = prog; then
3140 # Here we assume that one of hardcode_direct or hardcode_minus_L
3141 # is not unsupported. This is valid on all known static and
3143 if test "$hardcode_direct" != unsupported; then
3144 test -n "$old_library" && linklib="$old_library"
3145 compile_deplibs="$dir/$linklib $compile_deplibs"
3146 finalize_deplibs="$dir/$linklib $finalize_deplibs"
3148 compile_deplibs="-l$name -L$dir $compile_deplibs"
3149 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
3151 elif test "$build_libtool_libs" = yes; then
3152 # Not a shared library
3153 if test "$deplibs_check_method" != pass_all; then
3154 # We're trying link a shared library against a static one
3155 # but the system doesn't support it.
3157 # Just print a warning and add the library to dependency_libs so
3158 # that the program can be linked against the static library.
3160 $echo "*** Warning: This system can not link to static lib archive $lib."
3161 $echo "*** I have the capability to make that library automatically link in when"
3162 $echo "*** you link to this library. But I can only do this if you have a"
3163 $echo "*** shared version of the library, which you do not appear to have."
3164 if test "$module" = yes; then
3165 $echo "*** But as you try to build a module library, libtool will still create "
3166 $echo "*** a static module, that should work as long as the dlopening application"
3167 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
3168 if test -z "$global_symbol_pipe"; then
3170 $echo "*** However, this would only work if libtool was able to extract symbol"
3171 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3172 $echo "*** not find such a program. So, this module is probably useless."
3173 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3175 if test "$build_old_libs" = no; then
3176 build_libtool_libs=module
3179 build_libtool_libs=no
3183 deplibs="$dir/$old_library $deplibs"
3186 fi # link shared/static library?
3188 if test "$linkmode" = lib; then
3189 if test -n "$dependency_libs" &&
3190 { test "$hardcode_into_libs" != yes ||
3191 test "$build_old_libs" = yes ||
3192 test "$link_static" = yes; }; then
3193 # Extract -R from dependency_libs
3195 for libdir in $dependency_libs; do
3197 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
3199 *" $temp_xrpath "*) ;;
3200 *) xrpath="$xrpath $temp_xrpath";;
3202 *) temp_deplibs="$temp_deplibs $libdir";;
3205 dependency_libs="$temp_deplibs"
3208 newlib_search_path="$newlib_search_path $absdir"
3209 # Link against this library
3210 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
3211 # ... and its dependency_libs
3213 for deplib in $dependency_libs; do
3214 newdependency_libs="$deplib $newdependency_libs"
3215 if test "X$duplicate_deps" = "Xyes" ; then
3216 case "$tmp_libs " in
3217 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
3220 tmp_libs="$tmp_libs $deplib"
3223 if test "$link_all_deplibs" != no; then
3224 # Add the search paths of all dependency libraries
3225 for deplib in $dependency_libs; do
3227 -L*) path="$deplib" ;;
3229 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
3230 test "X$dir" = "X$deplib" && dir="."
3231 # We need an absolute path.
3233 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
3235 absdir=`cd "$dir" && pwd`
3236 if test -z "$absdir"; then
3237 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
3242 if grep "^installed=no" $deplib > /dev/null; then
3243 path="$absdir/$objdir"
3245 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3246 if test -z "$libdir"; then
3247 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3250 if test "$absdir" != "$libdir"; then
3251 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
3258 # we do not want to link against static libs,
3259 # but need to link against shared
3260 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
3261 if test -n "$deplibrary_names" ; then
3262 for tmp in $deplibrary_names ; do
3265 if test -f "$path/$depdepl" ; then
3266 depdepl="$path/$depdepl"
3268 # do not add paths which are already there
3269 case " $newlib_search_path " in
3271 *) newlib_search_path="$newlib_search_path $path";;
3284 # Again, we only want to link against shared libraries
3285 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
3286 for tmp in $newlib_search_path ; do
3287 if test -f "$tmp/lib$tmp_libs.dylib" ; then
3288 eval depdepl="$tmp/lib$tmp_libs.dylib"
3299 case " $deplibs " in
3301 *) deplibs="$path $deplibs" ;;
3303 case " $deplibs " in
3305 *) deplibs="$depdepl $deplibs" ;;
3308 fi # link_all_deplibs != no
3310 done # for deplib in $libs
3311 dependency_libs="$newdependency_libs"
3312 if test "$pass" = dlpreopen; then
3313 # Link the dlpreopened libraries before other libraries
3314 for deplib in $save_deplibs; do
3315 deplibs="$deplib $deplibs"
3318 if test "$pass" != dlopen; then
3319 if test "$pass" != conv; then
3320 # Make sure lib_search_path contains only unique directories.
3322 for dir in $newlib_search_path; do
3323 case "$lib_search_path " in
3325 *) lib_search_path="$lib_search_path $dir" ;;
3331 if test "$linkmode,$pass" != "prog,link"; then
3334 vars="compile_deplibs finalize_deplibs"
3336 for var in $vars dependency_libs; do
3337 # Add libraries to $var in reverse order
3338 eval tmp_libs=\"\$$var\"
3340 for deplib in $tmp_libs; do
3341 # FIXME: Pedantically, this is the right thing to do, so
3342 # that some nasty dependency loop isn't accidentally
3344 #new_libs="$deplib $new_libs"
3345 # Pragmatically, this seems to cause very few problems in
3348 -L*) new_libs="$deplib $new_libs" ;;
3351 # And here is the reason: when a library appears more
3352 # than once as an explicit dependence of a library, or
3353 # is implicitly linked in more than once by the
3354 # compiler, it is considered special, and multiple
3355 # occurrences thereof are not removed. Compare this
3356 # with having the same library being listed as a
3357 # dependency of multiple other libraries: in this case,
3358 # we know (pedantically, we assume) the library does not
3359 # need to be listed more than once, so we keep only the
3360 # last copy. This is not always right, but it is rare
3361 # enough that we require users that really mean to play
3362 # such unportable linking tricks to link the library
3363 # using -Wl,-lname, so that libtool does not consider it
3364 # for duplicate removal.
3365 case " $specialdeplibs " in
3366 *" $deplib "*) new_libs="$deplib $new_libs" ;;
3368 case " $new_libs " in
3370 *) new_libs="$deplib $new_libs" ;;
3378 for deplib in $new_libs; do
3381 case " $tmp_libs " in
3383 *) tmp_libs="$tmp_libs $deplib" ;;
3386 *) tmp_libs="$tmp_libs $deplib" ;;
3389 eval $var=\"$tmp_libs\"
3392 # Last step: remove runtime libs from dependency_libs
3393 # (they stay in deplibs)
3395 for i in $dependency_libs ; do
3396 case " $predeps $postdeps $compiler_lib_search_path " in
3401 if test -n "$i" ; then
3402 tmp_libs="$tmp_libs $i"
3405 dependency_libs=$tmp_libs
3407 if test "$linkmode" = prog; then
3408 dlfiles="$newdlfiles"
3409 dlprefiles="$newdlprefiles"
3414 if test -n "$deplibs"; then
3415 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
3418 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3419 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3422 if test -n "$rpath"; then
3423 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3426 if test -n "$xrpath"; then
3427 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3430 if test -n "$vinfo"; then
3431 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3434 if test -n "$release"; then
3435 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3438 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3439 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3442 # Now set the variables for building old libraries.
3443 build_libtool_libs=no
3445 objs="$objs$old_deplibs"
3449 # Make sure we only generate libraries of the form `libNAME.la'.
3452 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3453 eval shared_ext=\"$shrext_cmds\"
3454 eval libname=\"$libname_spec\"
3457 if test "$module" = no; then
3458 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3462 if test "$need_lib_prefix" != no; then
3463 # Add the "lib" prefix for modules if required
3464 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3465 eval shared_ext=\"$shrext_cmds\"
3466 eval libname=\"$libname_spec\"
3468 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3473 if test -n "$objs"; then
3474 if test "$deplibs_check_method" != pass_all; then
3475 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3479 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3480 $echo "*** objects $objs is not portable!"
3481 libobjs="$libobjs $objs"
3485 if test "$dlself" != no; then
3486 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3490 if test "$#" -gt 2; then
3491 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3496 if test -z "$rpath"; then
3497 if test "$build_libtool_libs" = yes; then
3498 # Building a libtool convenience library.
3499 # Some compilers have problems with a `.al' extension so
3500 # convenience libraries should have the same extension an
3501 # archive normally would.
3502 oldlibs="$output_objdir/$libname.$libext $oldlibs"
3503 build_libtool_libs=convenience
3507 if test -n "$vinfo"; then
3508 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3511 if test -n "$release"; then
3512 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3516 # Parse the version information argument.
3517 save_ifs="$IFS"; IFS=':'
3518 set dummy $vinfo 0 0 0
3521 if test -n "$8"; then
3522 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3527 # convert absolute version numbers to libtool ages
3528 # this retains compatibility with .la files and attempts
3529 # to make the code below a bit more comprehensible
3531 case $vinfo_number in
3535 number_revision="$4"
3537 # There are really only two kinds -- those that
3538 # use the current revision as the major version
3539 # and those that subtract age and use age as
3540 # a minor version. But, then there is irix
3541 # which has an extra 1 added just for fun
3543 case $version_type in
3544 darwin|linux|osf|windows)
3545 current=`expr $number_major + $number_minor`
3547 revision="$number_revision"
3549 freebsd-aout|freebsd-elf|sunos)
3550 current="$number_major"
3551 revision="$number_minor"
3555 current=`expr $number_major + $number_minor - 1`
3557 revision="$number_minor"
3560 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3561 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3573 # Check that each of the things are valid numbers.
3575 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3577 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3578 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3584 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3586 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3587 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3593 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3595 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3596 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3601 if test "$age" -gt "$current"; then
3602 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3603 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3607 # Calculate the version variables.
3611 case $version_type in
3615 # Like Linux, but with the current version available in
3616 # verstring for coding it into the library header
3617 major=.`expr $current - $age`
3618 versuffix="$major.$age.$revision"
3619 # Darwin ld doesn't like 0 for these options...
3620 minor_current=`expr $current + 1`
3621 verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3626 versuffix=".$current.$revision";
3631 versuffix=".$current";
3635 major=`expr $current - $age + 1`
3637 case $version_type in
3638 nonstopux) verstring_prefix=nonstopux ;;
3639 *) verstring_prefix=sgi ;;
3641 verstring="$verstring_prefix$major.$revision"
3643 # Add in all the interfaces that we are compatible with.
3645 while test "$loop" -ne 0; do
3646 iface=`expr $revision - $loop`
3647 loop=`expr $loop - 1`
3648 verstring="$verstring_prefix$major.$iface:$verstring"
3651 # Before this point, $major must not contain `.'.
3653 versuffix="$major.$revision"
3657 major=.`expr $current - $age`
3658 versuffix="$major.$age.$revision"
3662 major=.`expr $current - $age`
3663 versuffix=".$current.$age.$revision"
3664 verstring="$current.$age.$revision"
3666 # Add in all the interfaces that we are compatible with.
3668 while test "$loop" -ne 0; do
3669 iface=`expr $current - $loop`
3670 loop=`expr $loop - 1`
3671 verstring="$verstring:${iface}.0"
3674 # Make executables depend on our current version.
3675 verstring="$verstring:${current}.0"
3680 versuffix=".$current.$revision"
3684 # Use '-' rather than '.', since we only want one
3685 # extension on DOS 8.3 filesystems.
3686 major=`expr $current - $age`
3691 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3692 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3697 # Clear the version info if we defaulted, and they specified a release.
3698 if test -z "$vinfo" && test -n "$release"; then
3700 case $version_type in
3702 # we can't check for "0.0" in archive_cmds due to quoting
3703 # problems, so we reset it completely
3710 if test "$need_version" = no; then
3717 # Remove version info from name if versioning should be avoided
3718 if test "$avoid_version" = yes && test "$need_version" = no; then
3724 # Check to see if the archive will have undefined symbols.
3725 if test "$allow_undefined" = yes; then
3726 if test "$allow_undefined_flag" = unsupported; then
3727 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3728 build_libtool_libs=no
3732 # Don't allow undefined symbols.
3733 allow_undefined_flag="$no_undefined_flag"
3737 if test "$mode" != relink; then
3738 # Remove our outputs, but don't remove object files since they
3739 # may have been created when compiling PIC objects.
3741 tempremovelist=`$echo "$output_objdir/*"`
3742 for p in $tempremovelist; do
3746 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3747 if test "X$precious_files_regex" != "X"; then
3748 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3753 removelist="$removelist $p"
3758 if test -n "$removelist"; then
3759 $show "${rm}r $removelist"
3760 $run ${rm}r $removelist
3764 # Now set the variables for building old libraries.
3765 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3766 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3768 # Transform .lo files to .o files.
3769 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3772 # Eliminate all temporary directories.
3773 for path in $notinst_path; do
3774 lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
3775 deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
3776 dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
3779 if test -n "$xrpath"; then
3780 # If the user specified any rpath flags, then add them.
3782 for libdir in $xrpath; do
3783 temp_xrpath="$temp_xrpath -R$libdir"
3784 case "$finalize_rpath " in
3786 *) finalize_rpath="$finalize_rpath $libdir" ;;
3789 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3790 dependency_libs="$temp_xrpath $dependency_libs"
3794 # Make sure dlfiles contains only unique files that won't be dlpreopened
3795 old_dlfiles="$dlfiles"
3797 for lib in $old_dlfiles; do
3798 case " $dlprefiles $dlfiles " in
3800 *) dlfiles="$dlfiles $lib" ;;
3804 # Make sure dlprefiles contains only unique files
3805 old_dlprefiles="$dlprefiles"
3807 for lib in $old_dlprefiles; do
3808 case "$dlprefiles " in
3810 *) dlprefiles="$dlprefiles $lib" ;;
3814 if test "$build_libtool_libs" = yes; then
3815 if test -n "$rpath"; then
3817 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3818 # these systems don't actually have a c library (as such)!
3820 *-*-rhapsody* | *-*-darwin1.[012])
3821 # Rhapsody C library is in the System framework
3822 deplibs="$deplibs -framework System"
3825 # Don't link with libc until the a.out ld.so is fixed.
3827 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3828 # Do not include libc due to us having libc/libc_r.
3830 *-*-sco3.2v5* | *-*-sco5v6*)
3831 # Causes problems with __ctype
3833 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
3834 # Compiler inserts libc in the correct place for threads to work
3837 # Add libc to deplibs on all other systems if necessary.
3838 if test "$build_libtool_need_lc" = "yes"; then
3839 deplibs="$deplibs -lc"
3845 # Transform deplibs into only deplibs that can be linked in shared.
3847 libname_save=$libname
3848 release_save=$release
3849 versuffix_save=$versuffix
3851 # I'm not sure if I'm treating the release correctly. I think
3852 # release should show up in the -l (ie -lgmp5) so we don't want to
3853 # add it in twice. Is that correct?
3859 case $deplibs_check_method in
3861 # Don't check for shared/static. Everything works.
3862 # This might be a little naive. We might want to check
3863 # whether the library exists or not. But this is on
3864 # osf3 & osf4 and I'm not really sure... Just
3865 # implementing what was already the behavior.
3869 # This code stresses the "libraries are programs" paradigm to its
3870 # limits. Maybe even breaks it. We compile a program, linking it
3871 # against the deplibs as a proxy for the library. Then we can check
3872 # whether they linked in statically or dynamically with ldd.
3874 cat > conftest.c <<EOF
3875 int main() { return 0; }
3878 $LTCC $LTCFLAGS -o conftest conftest.c $deplibs
3879 if test "$?" -eq 0 ; then
3880 ldd_output=`ldd conftest`
3881 for i in $deplibs; do
3882 name=`expr $i : '-l\(.*\)'`
3883 # If $name is empty we are operating on a -L argument.
3884 if test "$name" != "" && test "$name" -ne "0"; then
3885 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3886 case " $predeps $postdeps " in
3888 newdeplibs="$newdeplibs $i"
3893 if test -n "$i" ; then
3894 libname=`eval \\$echo \"$libname_spec\"`
3895 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3896 set dummy $deplib_matches
3898 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3899 newdeplibs="$newdeplibs $i"
3903 $echo "*** Warning: dynamic linker does not accept needed library $i."
3904 $echo "*** I have the capability to make that library automatically link in when"
3905 $echo "*** you link to this library. But I can only do this if you have a"
3906 $echo "*** shared version of the library, which I believe you do not have"
3907 $echo "*** because a test_compile did reveal that the linker did not use it for"
3908 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3912 newdeplibs="$newdeplibs $i"
3916 # Error occurred in the first compile. Let's try to salvage
3917 # the situation: Compile a separate program for each library.
3918 for i in $deplibs; do
3919 name=`expr $i : '-l\(.*\)'`
3920 # If $name is empty we are operating on a -L argument.
3921 if test "$name" != "" && test "$name" != "0"; then
3923 $LTCC $LTCFLAGS -o conftest conftest.c $i
3925 if test "$?" -eq 0 ; then
3926 ldd_output=`ldd conftest`
3927 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3928 case " $predeps $postdeps " in
3930 newdeplibs="$newdeplibs $i"
3935 if test -n "$i" ; then
3936 libname=`eval \\$echo \"$libname_spec\"`
3937 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3938 set dummy $deplib_matches
3940 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3941 newdeplibs="$newdeplibs $i"
3945 $echo "*** Warning: dynamic linker does not accept needed library $i."
3946 $echo "*** I have the capability to make that library automatically link in when"
3947 $echo "*** you link to this library. But I can only do this if you have a"
3948 $echo "*** shared version of the library, which you do not appear to have"
3949 $echo "*** because a test_compile did reveal that the linker did not use this one"
3950 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3956 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3957 $echo "*** make it link in! You will probably need to install it or some"
3958 $echo "*** library that it depends on before this library will be fully"
3959 $echo "*** functional. Installing it before continuing would be even better."
3962 newdeplibs="$newdeplibs $i"
3968 set dummy $deplibs_check_method
3969 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3970 for a_deplib in $deplibs; do
3971 name=`expr $a_deplib : '-l\(.*\)'`
3972 # If $name is empty we are operating on a -L argument.
3973 if test "$name" != "" && test "$name" != "0"; then
3974 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3975 case " $predeps $postdeps " in
3977 newdeplibs="$newdeplibs $a_deplib"
3982 if test -n "$a_deplib" ; then
3983 libname=`eval \\$echo \"$libname_spec\"`
3984 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3985 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3986 for potent_lib in $potential_libs; do
3987 # Follow soft links.
3988 if ls -lLd "$potent_lib" 2>/dev/null \
3989 | grep " -> " >/dev/null; then
3992 # The statement above tries to avoid entering an
3993 # endless loop below, in case of cyclic links.
3994 # We might still enter an endless loop, since a link
3995 # loop can be closed while we follow links,
3997 potlib="$potent_lib"
3998 while test -h "$potlib" 2>/dev/null; do
3999 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
4001 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
4002 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
4005 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
4007 | $EGREP "$file_magic_regex" > /dev/null; then
4008 newdeplibs="$newdeplibs $a_deplib"
4015 if test -n "$a_deplib" ; then
4018 $echo "*** Warning: linker path does not have real file for library $a_deplib."
4019 $echo "*** I have the capability to make that library automatically link in when"
4020 $echo "*** you link to this library. But I can only do this if you have a"
4021 $echo "*** shared version of the library, which you do not appear to have"
4022 $echo "*** because I did check the linker path looking for a file starting"
4023 if test -z "$potlib" ; then
4024 $echo "*** with $libname but no candidates were found. (...for file magic test)"
4026 $echo "*** with $libname and none of the candidates passed a file format test"
4027 $echo "*** using a file magic. Last file checked: $potlib"
4031 # Add a -L argument.
4032 newdeplibs="$newdeplibs $a_deplib"
4034 done # Gone through all deplibs.
4037 set dummy $deplibs_check_method
4038 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
4039 for a_deplib in $deplibs; do
4040 name=`expr $a_deplib : '-l\(.*\)'`
4041 # If $name is empty we are operating on a -L argument.
4042 if test -n "$name" && test "$name" != "0"; then
4043 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4044 case " $predeps $postdeps " in
4046 newdeplibs="$newdeplibs $a_deplib"
4051 if test -n "$a_deplib" ; then
4052 libname=`eval \\$echo \"$libname_spec\"`
4053 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
4054 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
4055 for potent_lib in $potential_libs; do
4056 potlib="$potent_lib" # see symlink-check above in file_magic test
4057 if eval $echo \"$potent_lib\" 2>/dev/null \
4059 | $EGREP "$match_pattern_regex" > /dev/null; then
4060 newdeplibs="$newdeplibs $a_deplib"
4067 if test -n "$a_deplib" ; then
4070 $echo "*** Warning: linker path does not have real file for library $a_deplib."
4071 $echo "*** I have the capability to make that library automatically link in when"
4072 $echo "*** you link to this library. But I can only do this if you have a"
4073 $echo "*** shared version of the library, which you do not appear to have"
4074 $echo "*** because I did check the linker path looking for a file starting"
4075 if test -z "$potlib" ; then
4076 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
4078 $echo "*** with $libname and none of the candidates passed a file format test"
4079 $echo "*** using a regex pattern. Last file checked: $potlib"
4083 # Add a -L argument.
4084 newdeplibs="$newdeplibs $a_deplib"
4086 done # Gone through all deplibs.
4090 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
4091 -e 's/ -[LR][^ ]*//g'`
4092 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4093 for i in $predeps $postdeps ; do
4094 # can't use Xsed below, because $i might contain '/'
4095 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
4098 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
4099 | grep . >/dev/null; then
4101 if test "X$deplibs_check_method" = "Xnone"; then
4102 $echo "*** Warning: inter-library dependencies are not supported in this platform."
4104 $echo "*** Warning: inter-library dependencies are not known to be supported."
4106 $echo "*** All declared inter-library dependencies are being dropped."
4111 versuffix=$versuffix_save
4113 release=$release_save
4114 libname=$libname_save
4118 *-*-rhapsody* | *-*-darwin1.[012])
4119 # On Rhapsody replace the C library is the System framework
4120 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
4124 if test "$droppeddeps" = yes; then
4125 if test "$module" = yes; then
4127 $echo "*** Warning: libtool could not satisfy all declared inter-library"
4128 $echo "*** dependencies of module $libname. Therefore, libtool will create"
4129 $echo "*** a static module, that should work as long as the dlopening"
4130 $echo "*** application is linked with the -dlopen flag."
4131 if test -z "$global_symbol_pipe"; then
4133 $echo "*** However, this would only work if libtool was able to extract symbol"
4134 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
4135 $echo "*** not find such a program. So, this module is probably useless."
4136 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
4138 if test "$build_old_libs" = no; then
4139 oldlibs="$output_objdir/$libname.$libext"
4140 build_libtool_libs=module
4143 build_libtool_libs=no
4146 $echo "*** The inter-library dependencies that have been dropped here will be"
4147 $echo "*** automatically added whenever a program is linked with this library"
4148 $echo "*** or is declared to -dlopen it."
4150 if test "$allow_undefined" = no; then
4152 $echo "*** Since this library must not contain undefined symbols,"
4153 $echo "*** because either the platform does not support them or"
4154 $echo "*** it was explicitly requested with -no-undefined,"
4155 $echo "*** libtool will only create a static version of it."
4156 if test "$build_old_libs" = no; then
4157 oldlibs="$output_objdir/$libname.$libext"
4158 build_libtool_libs=module
4161 build_libtool_libs=no
4166 # Done checking deplibs!
4171 # move library search paths that coincide with paths to not yet
4172 # installed libraries to the beginning of the library search list
4174 for path in $notinst_path; do
4175 case " $new_libs " in
4176 *" -L$path/$objdir "*) ;;
4178 case " $deplibs " in
4179 *" -L$path/$objdir "*)
4180 new_libs="$new_libs -L$path/$objdir" ;;
4185 for deplib in $deplibs; do
4188 case " $new_libs " in
4190 *) new_libs="$new_libs $deplib" ;;
4193 *) new_libs="$new_libs $deplib" ;;
4199 # All the library-specific variables (install_libdir is set above).
4204 # Test again, we may have decided not to build it any more
4205 if test "$build_libtool_libs" = yes; then
4206 if test "$hardcode_into_libs" = yes; then
4207 # Hardcode the library paths
4210 rpath="$finalize_rpath"
4211 test "$mode" != relink && rpath="$compile_rpath$rpath"
4212 for libdir in $rpath; do
4213 if test -n "$hardcode_libdir_flag_spec"; then
4214 if test -n "$hardcode_libdir_separator"; then
4215 if test -z "$hardcode_libdirs"; then
4216 hardcode_libdirs="$libdir"
4218 # Just accumulate the unique libdirs.
4219 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4220 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4223 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4228 eval flag=\"$hardcode_libdir_flag_spec\"
4229 dep_rpath="$dep_rpath $flag"
4231 elif test -n "$runpath_var"; then
4232 case "$perm_rpath " in
4234 *) perm_rpath="$perm_rpath $libdir" ;;
4238 # Substitute the hardcoded libdirs into the rpath.
4239 if test -n "$hardcode_libdir_separator" &&
4240 test -n "$hardcode_libdirs"; then
4241 libdir="$hardcode_libdirs"
4242 if test -n "$hardcode_libdir_flag_spec_ld"; then
4243 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
4245 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
4248 if test -n "$runpath_var" && test -n "$perm_rpath"; then
4249 # We should set the runpath_var.
4251 for dir in $perm_rpath; do
4254 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
4256 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
4259 shlibpath="$finalize_shlibpath"
4260 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"