3 # libtoolT - Provide generalized library-building support services.
4 # Generated automatically by (GNU vimicxx 0.1)
5 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
7 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
8 # Free Software Foundation, Inc.
10 # This file is part of GNU Libtool:
11 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
13 # This program is free software; you can redistribute it and/or modify
14 # it under the terms of the GNU General Public License as published by
15 # the Free Software Foundation; either version 2 of the License, or
16 # (at your option) any later version.
18 # This program is distributed in the hope that it will be useful, but
19 # WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 # General Public License for more details.
23 # You should have received a copy of the GNU General Public License
24 # along with this program; if not, write to the Free Software
25 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27 # As a special exception to the GNU General Public License, if you
28 # distribute this file as part of a program that contains a
29 # configuration script generated by Autoconf, you may include it under
30 # the same distribution terms that you use for the rest of that program.
32 # A sed program that does not truncate output.
35 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
36 Xsed
="/usr/bin/sed -e 1s/^X//"
38 # The HP-UX ksh and POSIX shell print the target directory to stdout
40 (unset CDPATH
) >/dev
/null
2>&1 && unset CDPATH
42 # The names of the tagged configurations supported by this script.
45 # ### BEGIN LIBTOOL CONFIG
47 # Libtool was configured on host fireball:
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-suse-linux-gnu
74 build
=i686-suse-linux-gnu
77 # An echo program that does not interpret backslashes.
87 # LTCC compiler flags.
90 # A language-specific compiler.
93 # Is the compiler the GNU C compiler?
97 EGREP
="/usr/bin/grep -E"
99 # The linker used to build libraries.
100 LD
="/usr/i586-suse-linux/bin/ld"
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~\$RANLIB \$oldlib"
204 old_postinstall_cmds
="chmod 644 \$oldlib~\$RANLIB \$oldlib"
205 old_postuninstall_cmds
=""
207 # Create an old-style archive from a shared archive.
208 old_archive_from_new_cmds
=""
210 # Create a temporary old-style archive to link instead of a shared archive.
211 old_archive_from_expsyms_cmds
=""
213 # Commands used to build and install a shared archive.
214 archive_cmds
="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
215 archive_expsym_cmds
="\$echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
216 cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
217 \$echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
218 \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
220 postuninstall_cmds
=""
222 # Commands used to build a loadable module (assumed same as above if empty)
224 module_expsym_cmds
=""
226 # Commands to strip libraries.
227 old_striplib
="strip --strip-debug"
228 striplib
="strip --strip-unneeded"
230 # Dependencies to place before the objects being linked to create a
234 # Dependencies to place after the objects being linked to create a
238 # Dependencies to place before the objects being linked to create a
242 # Dependencies to place after the objects being linked to create a
246 # The directories searched by this compiler when creating a shared
248 compiler_lib_search_dirs
=""
250 # The library search path used internally by the compiler when linking
252 compiler_lib_search_path
=""
254 # Method to check whether dependent libraries are shared objects.
255 deplibs_check_method
="pass_all"
257 # Command to use when deplibs_check_method == file_magic.
258 file_magic_cmd
="\$MAGIC_CMD"
260 # Flag that allows shared libraries with undefined symbols to be built.
261 allow_undefined_flag
=""
263 # Flag that forces no undefined symbols.
266 # Commands used to finish a libtool library installation in a directory.
267 finish_cmds
="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
269 # Same as above, but a single script fragment to be evaled but not shown.
272 # Take the output of nm and produce a listing of raw symbols and C names.
273 global_symbol_pipe
="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
275 # Transform the output of nm in a proper C declaration
276 global_symbol_to_cdecl
="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
278 # Transform the output of nm in a C name address pair
279 global_symbol_to_c_name_address
="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
281 # This is the shared library runtime path variable.
282 runpath_var
=LD_RUN_PATH
284 # This is the shared library path variable.
285 shlibpath_var
=LD_LIBRARY_PATH
287 # Is shlibpath searched before the hard-coded library search path?
288 shlibpath_overrides_runpath
=no
290 # How to hardcode a shared library path into an executable.
291 hardcode_action
=immediate
293 # Whether we should hardcode library paths into libraries.
294 hardcode_into_libs
=yes
296 # Flag to hardcode $libdir into a binary during linking.
297 # This must work even if $libdir does not exist.
298 hardcode_libdir_flag_spec
="\${wl}--rpath \${wl}\$libdir"
300 # If ld is used when linking, flag to hardcode $libdir into
301 # a binary during linking. This must work even if $libdir does
303 hardcode_libdir_flag_spec_ld
=""
305 # Whether we need a single -rpath flag with a separated argument.
306 hardcode_libdir_separator
=""
308 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
312 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
316 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
317 # the resulting binary.
318 hardcode_shlibpath_var
=unsupported
320 # Set to yes if building a shared library automatically hardcodes DIR into the library
321 # and all subsequent libraries and executables linked against it.
322 hardcode_automatic
=no
324 # Variables whose values should be saved in libtool wrapper scripts and
325 # restored at relink time.
326 variables_saved_for_relink
="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
328 # Whether libtool must link a program against all its dependency libraries.
329 link_all_deplibs
=unknown
331 # Compile-time system search path for libraries
332 sys_lib_search_path_spec
="/usr/lib/gcc/i586-suse-linux/4.3 /usr/i586-suse-linux/lib /usr/lib /lib"
334 # Run-time system search path for libraries
335 sys_lib_dlsearch_path_spec
="/lib /usr/lib /usr/X11R6/lib/Xaw3d /usr/X11R6/lib /usr/lib/Xaw3d /usr/i386-suse-linux/lib /usr/local/lib /opt/kde3/lib /usr/lib/graphviz /usr/lib/graphviz/sharp /usr/lib/graphviz/java /usr/lib/graphviz/perl /usr/lib/graphviz/php /usr/lib/graphviz/ocaml /usr/lib/graphviz/python /usr/lib/graphviz/lua /usr/lib/graphviz/tcl /usr/lib/graphviz/guile /usr/lib/graphviz/ruby "
337 # Fix the shell variable $srcfile for the compiler.
340 # Set to yes if exported symbols are required.
341 always_export_symbols
=no
343 # The commands to list exported symbols.
344 export_symbols_cmds
="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
346 # The commands to extract the exported symbol list from a shared archive.
347 extract_expsyms_cmds
=""
349 # Symbols that should not be listed in the preloaded symbols.
350 exclude_expsyms
="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
352 # Symbols that must always be exported.
355 # ### END LIBTOOL CONFIG
357 # ltmain.sh - Provide generalized library-building support services.
358 # NOTE: Changing this file will not affect anything until you rerun configure.
360 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
361 # 2007 Free Software Foundation, Inc.
362 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
364 # This program is free software; you can redistribute it and/or modify
365 # it under the terms of the GNU General Public License as published by
366 # the Free Software Foundation; either version 2 of the License, or
367 # (at your option) any later version.
369 # This program is distributed in the hope that it will be useful, but
370 # WITHOUT ANY WARRANTY; without even the implied warranty of
371 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
372 # General Public License for more details.
374 # You should have received a copy of the GNU General Public License
375 # along with this program; if not, write to the Free Software
376 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
378 # As a special exception to the GNU General Public License, if you
379 # distribute this file as part of a program that contains a
380 # configuration script generated by Autoconf, you may include it under
381 # the same distribution terms that you use for the rest of that program.
385 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
386 # is ksh but when the shell is invoked as "sh" and the current value of
387 # the _XPG environment variable is not equal to 1 (one), the special
388 # positional parameter $0, within a function call, is the name of the
392 # The name of this program:
393 progname
=`echo "$progpath" | $SED $basename`
403 TIMESTAMP
=" (1.1220.2.455 2007/06/24 02:13:29)"
405 # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
406 if test -n "${ZSH_VERSION+set}" && (emulate sh
) >/dev
/null
2>&1; then
409 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
410 # is contrary to our usage. Disable this feature.
411 alias -g '${1+"$@"}'='"$@"'
414 case `(set -o) 2>/dev/null` in *posix
*) set -o posix
;; esac
416 BIN_SH
=xpg4
; export BIN_SH
# for Tru64
417 DUALCASE
=1; export DUALCASE
# for MKS sh
419 # Check that we have a working $echo.
420 if test "X$1" = X--no-reexec
; then
421 # Discard the --no-reexec flag, and continue.
423 elif test "X$1" = X--fallback-echo
; then
424 # Avoid inline document here, it may be left over
426 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
427 # Yippee, $echo works!
430 # Restart under the correct shell, and then maybe $echo will work.
431 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
434 if test "X$1" = X--fallback-echo
; then
435 # used as fallback echo
444 help="Try \`$progname --help' for more information."
445 magic
="%%%MAGIC variable%%%"
450 # Sed substitution that helps us do robust quoting. It backslashifies
451 # metacharacters that are still active within double-quoted strings.
452 Xsed
="${SED}"' -e 1s/^X//'
453 sed_quote_subst
='s/\([\\`\\"$\\\\]\)/\\\1/g'
454 # test EBCDIC or ASCII
455 case `echo X|tr X '\101'` in
456 A
) # ASCII based system
457 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
459 NL2SP
='tr \015\012 \040\040'
461 *) # EBCDIC based system
463 NL2SP
='tr \r\n \100\100'
468 # Only set LANG and LC_ALL to C if already set.
469 # These must not be set unconditionally because not all systems understand
470 # e.g. LANG=C (notably SCO).
471 # We save the old values to restore during execute mode.
472 for lt_var
in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
474 eval "if test \"\${$lt_var+set}\" = set; then
475 save_$lt_var=\$$lt_var
481 # Make sure IFS has a sensible default
486 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
487 $echo "$modename: not configured to build any kind of library" 1>&2
488 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
503 lo2o
="s/\\.lo\$/.${objext}/"
504 o2lo
="s/\\.${objext}\$/.lo/"
508 #####################################
509 # Shell function definitions:
510 # This seems to be the best place for them
512 # func_mktempdir [string]
513 # Make a temporary directory that won't clash with other running
514 # libtool processes, and avoids race conditions if possible. If
515 # given, STRING is the basename for that directory.
518 my_template
="${TMPDIR-/tmp}/${1-$progname}"
520 if test "$run" = ":"; then
521 # Return a directory name, but don't create it in dry-run mode
522 my_tmpdir
="${my_template}-$$"
525 # If mktemp works, use that first and foremost
526 my_tmpdir
=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
528 if test ! -d "$my_tmpdir"; then
529 # Failing that, at least try and use $RANDOM to avoid a race
530 my_tmpdir
="${my_template}-${RANDOM-0}$$"
532 save_mktempdir_umask
=`umask`
535 umask $save_mktempdir_umask
538 # If we're not in dry-run mode, bomb out on failure
539 test -d "$my_tmpdir" ||
{
540 $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
545 $echo "X$my_tmpdir" |
$Xsed
549 # func_win32_libid arg
550 # return the library type of file 'arg'
552 # Need a lot of goo to handle *both* DLLs and import libs
553 # Has to be a shell function in order to 'eat' the argument
554 # that is supplied when $file_magic_command is called.
557 win32_libid_type
="unknown"
558 win32_fileres
=`file -L $1 2>/dev/null`
559 case $win32_fileres in
560 *ar\ archive\ import\ library
*) # definitely import
561 win32_libid_type
="x86 archive import"
563 *ar\ archive
*) # could be an import, or static
564 if eval $OBJDUMP -f $1 |
$SED -e '10q' 2>/dev
/null | \
565 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev
/null
; then
566 win32_nmres
=`eval $NM -f posix -A $1 | \
575 import
*) win32_libid_type
="x86 archive import";;
576 *) win32_libid_type
="x86 archive static";;
581 win32_libid_type
="x86 DLL"
583 *executable
*) # but shell scripts are "executable" too...
584 case $win32_fileres in
585 *MS\ Windows\ PE\ Intel
*)
586 win32_libid_type
="x86 DLL"
591 $echo $win32_libid_type
596 # Infer tagged configuration to use if any are available and
597 # if one wasn't chosen via the "--tag" command line option.
598 # Only attempt this if the compiler in the base compile
599 # command doesn't match the default compiler.
600 # arg is usually of the form 'gcc ...'
603 if test -n "$available_tags" && test -z "$tagname"; then
607 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
611 CC_quoted
="$CC_quoted $arg"
614 # Blanks in the command may have been stripped by the calling shell,
615 # but not from the CC environment variable when configure was run.
616 " $CC "* |
"$CC "* |
" `$echo $CC` "* |
"`$echo $CC` "* |
" $CC_quoted"* |
"$CC_quoted "* |
" `$echo $CC_quoted` "* |
"`$echo $CC_quoted` "*) ;;
617 # Blanks at the start of $base_compile will cause this to fail
618 # if we don't check for them as well.
620 for z
in $available_tags; do
621 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev
/null
; then
622 # Evaluate the configuration.
623 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
626 # Double-quote args containing other shell metacharacters.
628 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
632 CC_quoted
="$CC_quoted $arg"
635 " $CC "* |
"$CC "* |
" `$echo $CC` "* |
"`$echo $CC` "* |
" $CC_quoted"* |
"$CC_quoted "* |
" `$echo $CC_quoted` "* |
"`$echo $CC_quoted` "*)
636 # The compiler in the base compile command matches
637 # the one in the tagged configuration.
638 # Assume this is the tagged configuration we want.
645 # If $tagname still isn't set, then no tagged configuration
646 # was found and let the user know that the "--tag" command
647 # line option must be used.
648 if test -z "$tagname"; then
649 $echo "$modename: unable to infer tagged configuration"
650 $echo "$modename: specify a tag with \`--tag'" 1>&2
653 # $echo "$modename: using $tagname tagged configuration"
661 # func_extract_an_archive dir oldlib
662 func_extract_an_archive
()
664 f_ex_an_ar_dir
="$1"; shift
665 f_ex_an_ar_oldlib
="$1"
667 $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
668 $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" ||
exit $?
669 if ($AR t
"$f_ex_an_ar_oldlib" |
sort |
sort -uc >/dev
/null
2>&1); then
672 $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
677 # func_extract_archives gentop oldlib ...
678 func_extract_archives
()
680 my_gentop
="$1"; shift
688 $show "${rm}r $my_gentop"
689 $run ${rm}r
"$my_gentop"
690 $show "$mkdir $my_gentop"
691 $run $mkdir "$my_gentop"
693 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
697 for my_xlib
in $my_oldlibs; do
698 # Extract the objects.
700 [\\/]* |
[A-Za-z
]:[\\/]*) my_xabs
="$my_xlib" ;;
701 *) my_xabs
=`pwd`"/$my_xlib" ;;
703 my_xlib
=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
706 case " $extracted_archives " in
708 extracted_serial
=`expr $extracted_serial + 1`
709 my_xlib_u
=lt
$extracted_serial-$my_xlib ;;
713 extracted_archives
="$extracted_archives $my_xlib_u"
714 my_xdir
="$my_gentop/$my_xlib_u"
716 $show "${rm}r $my_xdir"
717 $run ${rm}r
"$my_xdir"
718 $show "$mkdir $my_xdir"
719 $run $mkdir "$my_xdir"
721 if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
726 $show "Extracting $my_xabs"
727 # Do not bother doing anything if just a dry run
728 if test -z "$run"; then
729 darwin_orig_dir
=`pwd`
730 cd $my_xdir ||
exit $?
731 darwin_archive
=$my_xabs
733 darwin_base_archive
=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
734 darwin_arches
=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
735 if test -n "$darwin_arches"; then
736 darwin_arches
=`echo "$darwin_arches" | $SED -e 's/.*are://'`
738 $show "$darwin_base_archive has multiple architectures $darwin_arches"
739 for darwin_arch
in $darwin_arches ; do
740 mkdir
-p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
741 lipo
-thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
742 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
743 func_extract_an_archive
"`pwd`" "${darwin_base_archive}"
745 $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
746 done # $darwin_arches
747 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
748 darwin_filelist
=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
751 for darwin_file
in $darwin_filelist; do
752 darwin_files
=`find unfat-$$ -name $darwin_file -print | $NL2SP`
753 lipo
-create -output "$darwin_file" $darwin_files
754 done # $darwin_filelist
756 cd "$darwin_orig_dir"
758 cd "$darwin_orig_dir"
759 func_extract_an_archive
"$my_xdir" "$my_xabs"
764 func_extract_an_archive
"$my_xdir" "$my_xabs"
767 my_oldobjs
="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
769 func_extract_archives_result
="$my_oldobjs"
771 # End of Shell function definitions
772 #####################################
775 eval std_shrext
=\"$shrext_cmds\"
779 # Parse our command line options once, thoroughly.
780 while test "$#" -gt 0
786 -*=*) optarg
=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
790 # If the previous option needs an argument, assign it.
791 if test -n "$prev"; then
794 execute_dlfiles
="$execute_dlfiles $arg"
798 preserve_args
="${preserve_args}=$arg"
800 # Check whether tagname contains only valid characters
803 $echo "$progname: invalid tag name: $tagname" 1>&2
810 # Don't test for the "default" C tag, as we know, it's there, but
811 # not specially marked.
814 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev
/null
; then
815 taglist
="$taglist $tagname"
816 # Evaluate the configuration.
817 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
819 $echo "$progname: ignoring unknown tag $tagname" 1>&2
834 # Have we seen a non-optional argument yet?
842 $PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP
844 Copyright (C) 2007 Free Software Foundation, Inc.
845 This is free software; see the source for copying conditions. There is NO
846 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
851 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
852 # Now print the configurations for the tags.
853 for tagname
in $taglist; do
854 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
860 $echo "$progname: enabling shell trace mode"
862 preserve_args
="$preserve_args $arg"
871 if test "$build_libtool_libs" = yes; then
872 $echo "enable shared libraries"
874 $echo "disable shared libraries"
876 if test "$build_old_libs" = yes; then
877 $echo "enable static libraries"
879 $echo "disable static libraries"
884 --finish) mode
="finish" ;;
886 --mode) prevopt
="--mode" prev
=mode
;;
887 --mode=*) mode
="$optarg" ;;
889 --preserve-dup-deps) duplicate_deps
="yes" ;;
893 preserve_args
="$preserve_args $arg"
899 preserve_args
="$preserve_args --tag"
902 set tag
"$optarg" ${1+"$@"}
905 preserve_args
="$preserve_args --tag"
914 $echo "$modename: unrecognized option \`$arg'" 1>&2
926 if test -n "$prevopt"; then
927 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
932 case $disable_libs in
936 build_libtool_libs
=no
940 build_old_libs
=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
944 # If this variable is set in any of the actions, the command in it
945 # will be execed at the end. This prevents here-documents from being
946 # left over by shells.
949 if test -z "$show_help"; then
951 # Infer the operation mode.
952 if test -z "$mode"; then
953 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
954 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
956 *cc | cc
* |
*++ | gcc
* |
*-gcc* | g
++* | xlc
*)
968 *db |
*dbx |
*strace |
*truss
)
978 # If we have no mode, but dlfiles were specified, then do execute mode.
979 test -n "$execute_dlfiles" && mode
=execute
981 # Just use the default operation mode.
982 if test -z "$mode"; then
983 if test -n "$nonopt"; then
984 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
986 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
993 # Only execute mode is allowed to have -dlopen flags.
994 if test -n "$execute_dlfiles" && test "$mode" != execute
; then
995 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
1000 # Change the help message to a mode-specific one.
1001 generic_help
="$help"
1002 help="Try \`$modename --help --mode=$mode' for more information."
1004 # These modes are in order of execution frequency so that they run quickly.
1006 # libtool compile mode
1008 modename
="$modename: compile"
1009 # Get the compilation command and the source file.
1011 srcfile
="$nonopt" # always keep a non-empty value in "srcfile"
1022 # do not "continue". Instead, add this to base_compile
1034 # Accept any command-line options.
1037 if test -n "$libobj" ; then
1038 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
1045 -static |
-prefer-pic |
-prefer-non-pic)
1056 arg_mode
=arg
# the next one goes into the "base_compile" arg list
1057 continue # The current "srcfile" will either be retained or
1058 ;; # replaced later. I would guess that would be a bug.
1061 args
=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
1063 save_ifs
="$IFS"; IFS
=','
1064 for arg
in $args; do
1067 # Double-quote args containing other shell metacharacters.
1068 # Many Bourne shells cannot handle close brackets correctly
1069 # in scan sets, so we specify it separately.
1071 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1075 lastarg
="$lastarg $arg"
1078 lastarg
=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
1080 # Add the arguments to base_compile.
1081 base_compile
="$base_compile $lastarg"
1086 # Accept the current argument as the source file.
1087 # The previous "srcfile" becomes the current argument.
1094 esac # case $arg_mode
1096 # Aesthetically quote the previous argument.
1097 lastarg
=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
1100 # Double-quote args containing other shell metacharacters.
1101 # Many Bourne shells cannot handle close brackets correctly
1102 # in scan sets, and some SunOS ksh mistreat backslash-escaping
1103 # in scan sets (worked around with variable expansion),
1104 # and furthermore cannot handle '|' '&' '(' ')' in scan sets
1105 # at all, so we specify them separately.
1106 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1107 lastarg
="\"$lastarg\""
1111 base_compile
="$base_compile $lastarg"
1116 $echo "$modename: you must specify an argument for -Xcompile"
1120 $echo "$modename: you must specify a target with \`-o'" 1>&2
1124 # Get the name of the library object.
1125 [ -z "$libobj" ] && libobj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
1129 # Recognize several different file suffixes.
1130 # If the user specifies -o file.o, it is replaced with file.lo
1140 *.class
) xform
=class
;;
1143 *.
[fF
][09]?
) xform
=[fF
][09].
;;
1145 *.java
) xform
=java
;;
1149 libobj
=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
1152 *.lo
) obj
=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
1154 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
1159 func_infer_tag
$base_compile
1161 for arg
in $later; do
1180 qlibobj
=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
1182 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1183 qlibobj
="\"$qlibobj\"" ;;
1185 test "X$libobj" != "X$qlibobj" \
1186 && $echo "X$libobj" |
grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
1187 && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
1188 objname
=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
1189 xdir
=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
1190 if test "X$xdir" = "X$obj"; then
1195 lobj
=${xdir}$objdir/$objname
1197 if test -z "$base_compile"; then
1198 $echo "$modename: you must specify a compilation command" 1>&2
1203 # Delete any leftover library objects.
1204 if test "$build_old_libs" = yes; then
1205 removelist
="$obj $lobj $libobj ${libobj}T"
1207 removelist
="$lobj $libobj ${libobj}T"
1210 $run $rm $removelist
1211 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1213 # On Cygwin there's no "real" PIC flag so we must build both object types
1215 cygwin
* | mingw
* | pw32
* | os2
*)
1219 if test "$pic_mode" = no
&& test "$deplibs_check_method" != pass_all
; then
1220 # non-PIC code in shared libraries is not supported
1224 # Calculate the filename of the output object if compiler does
1225 # not support -o with -c
1226 if test "$compiler_c_o" = no
; then
1227 output_obj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.
${objext}
1228 lockfile
="$output_obj.lock"
1229 removelist
="$removelist $output_obj $lockfile"
1230 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1237 # Lock this critical section if it is needed
1238 # We use this script file to make the link, it avoids creating a new file
1239 if test "$need_locks" = yes; then
1240 until $run ln "$progpath" "$lockfile" 2>/dev
/null
; do
1241 $show "Waiting for $lockfile to be removed"
1244 elif test "$need_locks" = warn
; then
1245 if test -f "$lockfile"; then
1247 *** ERROR, $lockfile exists and contains:
1248 `cat $lockfile 2>/dev/null`
1250 This indicates that another process is trying to use the same
1251 temporary object file, and libtool could not work around it because
1252 your compiler does not support \`-c' and \`-o' together. If you
1253 repeat this compilation, it may succeed, by chance, but you had better
1254 avoid parallel builds (make -j) in this platform, or get a better
1257 $run $rm $removelist
1260 $echo "$srcfile" > "$lockfile"
1263 if test -n "$fix_srcfile_path"; then
1264 eval srcfile
=\"$fix_srcfile_path\"
1266 qsrcfile
=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
1268 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1269 qsrcfile
="\"$qsrcfile\"" ;;
1272 $run $rm "$libobj" "${libobj}T"
1274 # Create a libtool object file (analogous to a ".la" file),
1275 # but don't create it if we're doing a dry run.
1276 test -z "$run" && cat > ${libobj}T
<<EOF
1277 # $libobj - a libtool object file
1278 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
1280 # Please DO NOT delete this file!
1281 # It is necessary for linking the library.
1283 # Name of the PIC object.
1286 # Only build a PIC object if we are building libtool libraries.
1287 if test "$build_libtool_libs" = yes; then
1288 # Without this assignment, base_compile gets emptied.
1289 fbsd_hideous_sh_bug
=$base_compile
1291 if test "$pic_mode" != no
; then
1292 command="$base_compile $qsrcfile $pic_flag"
1294 # Don't build PIC code
1295 command="$base_compile $qsrcfile"
1298 if test ! -d "${xdir}$objdir"; then
1299 $show "$mkdir ${xdir}$objdir"
1300 $run $mkdir ${xdir}$objdir
1302 if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
1307 if test -z "$output_obj"; then
1308 # Place PIC objects in $objdir
1309 command="$command -o $lobj"
1312 $run $rm "$lobj" "$output_obj"
1315 if $run eval "$command"; then :
1317 test -n "$output_obj" && $run $rm $removelist
1321 if test "$need_locks" = warn
&&
1322 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1324 *** ERROR, $lockfile contains:
1325 `cat $lockfile 2>/dev/null`
1327 but it should contain:
1330 This indicates that another process is trying to use the same
1331 temporary object file, and libtool could not work around it because
1332 your compiler does not support \`-c' and \`-o' together. If you
1333 repeat this compilation, it may succeed, by chance, but you had better
1334 avoid parallel builds (make -j) in this platform, or get a better
1337 $run $rm $removelist
1341 # Just move the object if needed, then go on to compile the next one
1342 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1343 $show "$mv $output_obj $lobj"
1344 if $run $mv $output_obj $lobj; then :
1347 $run $rm $removelist
1352 # Append the name of the PIC object to the libtool object file.
1353 test -z "$run" && cat >> ${libobj}T
<<EOF
1354 pic_object='$objdir/$objname'
1358 # Allow error messages only from the first compilation.
1359 if test "$suppress_opt" = yes; then
1360 suppress_output
=' >/dev/null 2>&1'
1363 # No PIC object so indicate it doesn't exist in the libtool
1365 test -z "$run" && cat >> ${libobj}T
<<EOF
1371 # Only build a position-dependent object if we build old libraries.
1372 if test "$build_old_libs" = yes; then
1373 if test "$pic_mode" != yes; then
1374 # Don't build PIC code
1375 command="$base_compile $qsrcfile"
1377 command="$base_compile $qsrcfile $pic_flag"
1379 if test "$compiler_c_o" = yes; then
1380 command="$command -o $obj"
1383 # Suppress compiler output if we already did a PIC compilation.
1384 command="$command$suppress_output"
1385 $run $rm "$obj" "$output_obj"
1387 if $run eval "$command"; then :
1389 $run $rm $removelist
1393 if test "$need_locks" = warn
&&
1394 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1396 *** ERROR, $lockfile contains:
1397 `cat $lockfile 2>/dev/null`
1399 but it should contain:
1402 This indicates that another process is trying to use the same
1403 temporary object file, and libtool could not work around it because
1404 your compiler does not support \`-c' and \`-o' together. If you
1405 repeat this compilation, it may succeed, by chance, but you had better
1406 avoid parallel builds (make -j) in this platform, or get a better
1409 $run $rm $removelist
1413 # Just move the object if needed
1414 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1415 $show "$mv $output_obj $obj"
1416 if $run $mv $output_obj $obj; then :
1419 $run $rm $removelist
1424 # Append the name of the non-PIC object the libtool object file.
1425 # Only append if the libtool object file exists.
1426 test -z "$run" && cat >> ${libobj}T
<<EOF
1427 # Name of the non-PIC object.
1428 non_pic_object='$objname'
1432 # Append the name of the non-PIC object the libtool object file.
1433 # Only append if the libtool object file exists.
1434 test -z "$run" && cat >> ${libobj}T
<<EOF
1435 # Name of the non-PIC object.
1441 $run $mv "${libobj}T" "${libobj}"
1443 # Unlock the critical section if it was locked
1444 if test "$need_locks" != no
; then
1445 $run $rm "$lockfile"
1453 modename
="$modename: link"
1455 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1456 # It is impossible to link a dll without this setting, and
1457 # we shouldn't force the makefile maintainer to figure out
1458 # which system we are compiling for in order to pass an extra
1459 # flag for every libtool invocation.
1460 # allow_undefined=no
1462 # FIXME: Unfortunately, there are problems with the above when trying
1463 # to make a dll which has undefined symbols, in which case not
1464 # even a static library is built. For now, we need to specify
1465 # -no-undefined on the libtool link line when we can be certain
1466 # that all symbols are satisfied, otherwise we get a static library.
1473 libtool_args
="$nonopt"
1474 base_compile
="$nonopt $@"
1475 compile_command
="$nonopt"
1476 finalize_command
="$nonopt"
1489 lib_search_path
=`pwd`
1498 export_symbols_regex
=
1506 notinst_path
= # paths that contain not-installed libtool libraries
1507 precious_files_regex
=
1508 prefer_static_libs
=no
1521 func_infer_tag
$base_compile
1523 # We need to know -static, to get the right output filenames.
1527 -all-static |
-static |
-static-libtool-libs)
1530 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1531 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1533 if test -n "$link_static_flag"; then
1534 dlopen_self
=$dlopen_self_static
1536 prefer_static_libs
=yes
1539 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1540 dlopen_self
=$dlopen_self_static
1542 prefer_static_libs
=built
1544 -static-libtool-libs)
1545 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1546 dlopen_self
=$dlopen_self_static
1548 prefer_static_libs
=yes
1551 build_libtool_libs
=no
1558 # See if our shared archives depend on static archives.
1559 test -n "$old_archive_from_new_cmds" && build_old_libs
=yes
1561 # Go through the arguments, transforming them on the way.
1562 while test "$#" -gt 0; do
1566 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1567 qarg
=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1571 libtool_args
="$libtool_args $qarg"
1573 # If the previous option needs an argument, assign it.
1574 if test -n "$prev"; then
1577 compile_command
="$compile_command @OUTPUT@"
1578 finalize_command
="$finalize_command @OUTPUT@"
1584 if test "$preload" = no
; then
1585 # Add the symbol object into the linking commands.
1586 compile_command
="$compile_command @SYMFILE@"
1587 finalize_command
="$finalize_command @SYMFILE@"
1591 *.la |
*.lo
) ;; # We handle these cases below.
1593 if test "$dlself" = no
; then
1601 if test "$prev" = dlprefiles
; then
1603 elif test "$prev" = dlfiles
&& test "$dlopen_self" != yes; then
1613 if test "$prev" = dlfiles
; then
1614 dlfiles
="$dlfiles $arg"
1616 dlprefiles
="$dlprefiles $arg"
1624 export_symbols
="$arg"
1625 if test ! -f "$arg"; then
1626 $echo "$modename: symbol file \`$arg' does not exist"
1633 export_symbols_regex
="$arg"
1638 inst_prefix_dir
="$arg"
1643 precious_files_regex
="$arg"
1653 if test -f "$arg"; then
1656 for fil
in `cat $save_arg`
1658 # moreargs="$moreargs $fil"
1660 # A libtool-controlled object.
1662 # Check to see that this really is a libtool object.
1663 if (${SED} -e '2q' $arg |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1668 # If there is no directory component, then add one.
1670 */* |
*\\*) .
$arg ;;
1674 if test -z "$pic_object" || \
1675 test -z "$non_pic_object" ||
1676 test "$pic_object" = none
&& \
1677 test "$non_pic_object" = none
; then
1678 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1682 # Extract subdirectory from the argument.
1683 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1684 if test "X$xdir" = "X$arg"; then
1690 if test "$pic_object" != none
; then
1691 # Prepend the subdirectory the object is found in.
1692 pic_object
="$xdir$pic_object"
1694 if test "$prev" = dlfiles
; then
1695 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1696 dlfiles
="$dlfiles $pic_object"
1700 # If libtool objects are unsupported, then we need to preload.
1705 # CHECK ME: I think I busted this. -Ossama
1706 if test "$prev" = dlprefiles
; then
1707 # Preload the old-style object.
1708 dlprefiles
="$dlprefiles $pic_object"
1713 libobjs
="$libobjs $pic_object"
1718 if test "$non_pic_object" != none
; then
1719 # Prepend the subdirectory the object is found in.
1720 non_pic_object
="$xdir$non_pic_object"
1722 # A standard non-PIC object
1723 non_pic_objects
="$non_pic_objects $non_pic_object"
1724 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1725 arg
="$non_pic_object"
1728 # If the PIC object exists, use it instead.
1729 # $xdir was prepended to $pic_object above.
1730 non_pic_object
="$pic_object"
1731 non_pic_objects
="$non_pic_objects $non_pic_object"
1734 # Only an error if not doing a dry-run.
1735 if test -z "$run"; then
1736 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1741 # Extract subdirectory from the argument.
1742 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1743 if test "X$xdir" = "X$arg"; then
1749 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1750 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1751 libobjs
="$libobjs $pic_object"
1752 non_pic_objects
="$non_pic_objects $non_pic_object"
1757 $echo "$modename: link input file \`$save_arg' does not exist"
1765 # We need an absolute path.
1767 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1769 $echo "$modename: only absolute run-paths are allowed" 1>&2
1773 if test "$prev" = rpath
; then
1776 *) rpath
="$rpath $arg" ;;
1781 *) xrpath
="$xrpath $arg" ;;
1788 compiler_flags
="$compiler_flags $qarg"
1790 compile_command
="$compile_command $qarg"
1791 finalize_command
="$finalize_command $qarg"
1795 linker_flags
="$linker_flags $qarg"
1796 compiler_flags
="$compiler_flags $wl$qarg"
1798 compile_command
="$compile_command $wl$qarg"
1799 finalize_command
="$finalize_command $wl$qarg"
1803 linker_flags
="$linker_flags $qarg"
1804 compiler_flags
="$compiler_flags $qarg"
1806 compile_command
="$compile_command $qarg"
1807 finalize_command
="$finalize_command $qarg"
1815 darwin_framework|darwin_framework_skip
)
1816 test "$prev" = "darwin_framework" && compiler_flags
="$compiler_flags $arg"
1817 compile_command
="$compile_command $arg"
1818 finalize_command
="$finalize_command $arg"
1823 eval "$prev=\"\$arg\""
1828 fi # test -n "$prev"
1834 if test -n "$link_static_flag"; then
1835 compile_command
="$compile_command $link_static_flag"
1836 finalize_command
="$finalize_command $link_static_flag"
1842 # FIXME: remove this flag sometime in the future.
1843 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1867 -export-symbols |
-export-symbols-regex)
1868 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
1869 $echo "$modename: more than one -exported-symbols argument is not allowed"
1872 if test "X$arg" = "X-export-symbols"; then
1880 -framework|
-arch|
-isysroot)
1882 *" ${arg} ${1} "* | *" ${arg} ${1} "*)
1883 prev
=darwin_framework_skip
;;
1884 *) compiler_flags
="$compiler_flags $arg"
1885 prev
=darwin_framework
;;
1887 compile_command
="$compile_command $arg"
1888 finalize_command
="$finalize_command $arg"
1897 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1898 # so, if we see these flags be careful not to treat them like -L
1900 case $with_gcc/$host in
1901 no
/*-*-irix* |
/*-*-irix*)
1902 compile_command
="$compile_command $arg"
1903 finalize_command
="$finalize_command $arg"
1910 dir
=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1911 # We need an absolute path.
1913 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1915 absdir
=`cd "$dir" && pwd`
1916 if test -z "$absdir"; then
1917 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1919 notinst_path
="$notinst_path $dir"
1927 deplibs
="$deplibs -L$dir"
1928 lib_search_path
="$lib_search_path $dir"
1932 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1933 testbindir
=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1934 case :$dllsearchpath: in
1936 *) dllsearchpath
="$dllsearchpath:$dir";;
1938 case :$dllsearchpath: in
1939 *":$testbindir:"*) ;;
1940 *) dllsearchpath
="$dllsearchpath:$testbindir";;
1948 if test "X$arg" = "X-lc" ||
test "X$arg" = "X-lm"; then
1950 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-beos*)
1951 # These systems don't actually have a C or math library (as such)
1955 # These systems don't actually have a C library (as such)
1956 test "X$arg" = "X-lc" && continue
1958 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
1959 # Do not include libc due to us having libc/libc_r.
1960 test "X$arg" = "X-lc" && continue
1962 *-*-rhapsody* |
*-*-darwin1.
[012])
1963 # Rhapsody C and math libraries are in the System framework
1964 deplibs
="$deplibs -framework System"
1967 *-*-sco3.2v5
* |
*-*-sco5v6*)
1968 # Causes problems with __ctype
1969 test "X$arg" = "X-lc" && continue
1971 *-*-sysv4.2uw2
* |
*-*-sysv5* |
*-*-unixware* |
*-*-OpenUNIX*)
1972 # Compiler inserts libc in the correct place for threads to work
1973 test "X$arg" = "X-lc" && continue
1976 elif test "X$arg" = "X-lc_r"; then
1978 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
1979 # Do not include libc_r directly, use -pthread flag.
1984 deplibs
="$deplibs $arg"
1988 # Tru64 UNIX uses -model [arg] to determine the layout of C++
1989 # classes, name mangling, and exception handling.
1991 compile_command
="$compile_command $arg"
1992 compiler_flags
="$compiler_flags $arg"
1993 finalize_command
="$finalize_command $arg"
1998 -mt|
-mthreads|
-kthread|
-Kthread|
-pthread|
-pthreads|
--thread-safe|
-threads)
1999 compiler_flags
="$compiler_flags $arg"
2000 compile_command
="$compile_command $arg"
2001 finalize_command
="$finalize_command $arg"
2010 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
2011 # -r[0-9][0-9]* specifies the processor on the SGI compiler
2012 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
2013 # +DA*, +DD* enable 64-bit mode on the HP compiler
2014 # -q* pass through compiler args for the IBM compiler
2015 # -m* pass through architecture-specific compiler args for GCC
2016 # -m*, -t[45]*, -txscale* pass through architecture-specific
2017 # compiler args for GCC
2018 # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
2019 # -F/path gives path to uninstalled frameworks, gcc on darwin
2020 # @file GCC response files
2021 -64|
-mips[0-9]|
-r[0-9][0-9]*|
-xarch=*|
-xtarget=*|
+DA
*|
+DD
*|
-q*|
-m*| \
2022 -t[45]*|
-txscale*|
-p|
-pg|
--coverage|
-fprofile-*|
-F*|@
*)
2024 # Unknown arguments in both finalize_command and compile_command need
2025 # to be aesthetically quoted because they are evaled later.
2026 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2028 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2032 compile_command
="$compile_command $arg"
2033 finalize_command
="$finalize_command $arg"
2034 compiler_flags
="$compiler_flags $arg"
2050 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2* |
*-*-darwin*)
2051 # The PATH hackery in wrapper scripts is required on Windows
2052 # and Darwin in order for the loader to find any dlls it needs.
2053 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
2054 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
2057 *) no_install
=yes ;;
2074 -precious-files-regex)
2095 dir
=`$echo "X$arg" | $Xsed -e 's/^-R//'`
2096 # We need an absolute path.
2098 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
2100 $echo "$modename: only absolute run-paths are allowed" 1>&2
2106 *) xrpath
="$xrpath $dir" ;;
2111 -static |
-static-libtool-libs)
2112 # The effects of -static are defined in a previous loop.
2113 # We used to do the same as -all-static on platforms that
2114 # didn't have a PIC flag, but the assumption that the effects
2115 # would be equivalent was wrong. It would break on at least
2116 # Digital Unix and AIX.
2136 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
2138 save_ifs
="$IFS"; IFS
=','
2139 for flag
in $args; do
2142 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2147 compiler_flags
="$compiler_flags $flag"
2150 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
2154 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
2156 save_ifs
="$IFS"; IFS
=','
2157 for flag
in $args; do
2160 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2165 compiler_flags
="$compiler_flags $wl$flag"
2166 linker_flags
="$linker_flags $flag"
2169 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
2187 # Some other compiler flag.
2189 # Unknown arguments in both finalize_command and compile_command need
2190 # to be aesthetically quoted because they are evaled later.
2191 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2193 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2200 # A standard object.
2205 # A libtool-controlled object.
2207 # Check to see that this really is a libtool object.
2208 if (${SED} -e '2q' $arg |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
2213 # If there is no directory component, then add one.
2215 */* |
*\\*) .
$arg ;;
2219 if test -z "$pic_object" || \
2220 test -z "$non_pic_object" ||
2221 test "$pic_object" = none
&& \
2222 test "$non_pic_object" = none
; then
2223 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
2227 # Extract subdirectory from the argument.
2228 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2229 if test "X$xdir" = "X$arg"; then
2235 if test "$pic_object" != none
; then
2236 # Prepend the subdirectory the object is found in.
2237 pic_object
="$xdir$pic_object"
2239 if test "$prev" = dlfiles
; then
2240 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
2241 dlfiles
="$dlfiles $pic_object"
2245 # If libtool objects are unsupported, then we need to preload.
2250 # CHECK ME: I think I busted this. -Ossama
2251 if test "$prev" = dlprefiles
; then
2252 # Preload the old-style object.
2253 dlprefiles
="$dlprefiles $pic_object"
2258 libobjs
="$libobjs $pic_object"
2263 if test "$non_pic_object" != none
; then
2264 # Prepend the subdirectory the object is found in.
2265 non_pic_object
="$xdir$non_pic_object"
2267 # A standard non-PIC object
2268 non_pic_objects
="$non_pic_objects $non_pic_object"
2269 if test -z "$pic_object" ||
test "$pic_object" = none
; then
2270 arg
="$non_pic_object"
2273 # If the PIC object exists, use it instead.
2274 # $xdir was prepended to $pic_object above.
2275 non_pic_object
="$pic_object"
2276 non_pic_objects
="$non_pic_objects $non_pic_object"
2279 # Only an error if not doing a dry-run.
2280 if test -z "$run"; then
2281 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
2286 # Extract subdirectory from the argument.
2287 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2288 if test "X$xdir" = "X$arg"; then
2294 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
2295 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
2296 libobjs
="$libobjs $pic_object"
2297 non_pic_objects
="$non_pic_objects $non_pic_object"
2304 deplibs
="$deplibs $arg"
2305 old_deplibs
="$old_deplibs $arg"
2310 # A libtool-controlled library.
2312 if test "$prev" = dlfiles
; then
2313 # This library was specified with -dlopen.
2314 dlfiles
="$dlfiles $arg"
2316 elif test "$prev" = dlprefiles
; then
2317 # The library was specified with -dlpreopen.
2318 dlprefiles
="$dlprefiles $arg"
2321 deplibs
="$deplibs $arg"
2326 # Some other compiler argument.
2328 # Unknown arguments in both finalize_command and compile_command need
2329 # to be aesthetically quoted because they are evaled later.
2330 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2332 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2339 # Now actually substitute the argument into the commands.
2340 if test -n "$arg"; then
2341 compile_command
="$compile_command $arg"
2342 finalize_command
="$finalize_command $arg"
2344 done # argument parsing loop
2346 if test -n "$prev"; then
2347 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
2352 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
2353 eval arg
=\"$export_dynamic_flag_spec\"
2354 compile_command
="$compile_command $arg"
2355 finalize_command
="$finalize_command $arg"
2359 # calculate the name of the file, without its directory
2360 outputname
=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
2361 libobjs_save
="$libobjs"
2363 if test -n "$shlibpath_var"; then
2364 # get the directories listed in $shlibpath_var
2365 eval shlib_search_path
=\
`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2369 eval sys_lib_search_path
=\"$sys_lib_search_path_spec\"
2370 eval sys_lib_dlsearch_path
=\"$sys_lib_dlsearch_path_spec\"
2372 output_objdir
=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2373 if test "X$output_objdir" = "X$output"; then
2374 output_objdir
="$objdir"
2376 output_objdir
="$output_objdir/$objdir"
2378 # Create the object directory.
2379 if test ! -d "$output_objdir"; then
2380 $show "$mkdir $output_objdir"
2381 $run $mkdir $output_objdir
2383 if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
2388 # Determine the type of output
2391 $echo "$modename: you must specify an output file" 1>&2
2395 *.
$libext) linkmode
=oldlib
;;
2396 *.lo |
*.
$objext) linkmode
=obj
;;
2397 *.la
) linkmode
=lib
;;
2398 *) linkmode
=prog
;; # Anything else should be a program.
2402 *cygwin
* |
*mingw
* |
*pw32
*)
2403 # don't eliminate duplications in $postdeps and $predeps
2404 duplicate_compiler_generated_deps
=yes
2407 duplicate_compiler_generated_deps
=$duplicate_deps
2413 # Find all interdependent deplibs by searching for libraries
2414 # that are linked more than once (e.g. -la -lb -la)
2415 for deplib
in $deplibs; do
2416 if test "X$duplicate_deps" = "Xyes" ; then
2418 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2421 libs
="$libs $deplib"
2424 if test "$linkmode" = lib
; then
2425 libs
="$predeps $libs $compiler_lib_search_path $postdeps"
2427 # Compute libraries that are listed more than once in $predeps
2428 # $postdeps and mark them as special (i.e., whose duplicates are
2429 # not to be eliminated).
2431 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2432 for pre_post_dep
in $predeps $postdeps; do
2433 case "$pre_post_deps " in
2434 *" $pre_post_dep "*) specialdeplibs
="$specialdeplibs $pre_post_deps" ;;
2436 pre_post_deps
="$pre_post_deps $pre_post_dep"
2445 need_relink
=no
# whether we're linking any uninstalled libtool libraries
2446 notinst_deplibs
= # not-installed libtool libraries
2450 for file in $dlfiles $dlprefiles; do
2454 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2466 passes
="conv scan dlopen dlpreopen link"
2471 for pass
in $passes; do
2472 if test "$linkmode,$pass" = "lib,link" ||
2473 test "$linkmode,$pass" = "prog,scan"; then
2477 if test "$linkmode" = prog
; then
2479 dlopen
) libs
="$dlfiles" ;;
2480 dlpreopen
) libs
="$dlprefiles" ;;
2481 link
) libs
="$deplibs %DEPLIBS% $dependency_libs" ;;
2484 if test "$pass" = dlopen
; then
2485 # Collect dlpreopened libraries
2486 save_deplibs
="$deplibs"
2489 for deplib
in $libs; do
2493 -mt|
-mthreads|
-kthread|
-Kthread|
-pthread|
-pthreads|
--thread-safe|
-threads)
2494 if test "$linkmode,$pass" = "prog,link"; then
2495 compile_deplibs
="$deplib $compile_deplibs"
2496 finalize_deplibs
="$deplib $finalize_deplibs"
2498 compiler_flags
="$compiler_flags $deplib"
2503 if test "$linkmode" != lib
&& test "$linkmode" != prog
; then
2504 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2507 name
=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2508 for searchdir
in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2509 for search_ext
in .la
$std_shrext .so .a
; do
2510 # Search the libtool library
2511 lib
="$searchdir/lib${name}${search_ext}"
2512 if test -f "$lib"; then
2513 if test "$search_ext" = ".la"; then
2522 if test "$found" != yes; then
2523 # deplib doesn't seem to be a libtool library
2524 if test "$linkmode,$pass" = "prog,link"; then
2525 compile_deplibs
="$deplib $compile_deplibs"
2526 finalize_deplibs
="$deplib $finalize_deplibs"
2528 deplibs
="$deplib $deplibs"
2529 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
2532 else # deplib is a libtool library
2533 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2534 # We need to do some special things here, and not later.
2535 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2536 case " $predeps $postdeps " in
2538 if (${SED} -e '2q' $lib |
2539 grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
2543 */* |
*\\*) .
$lib ;;
2546 for l
in $old_library $library_names; do
2549 if test "X$ll" = "X$old_library" ; then # only static version available
2551 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2552 test "X$ladir" = "X$lib" && ladir
="."
2553 lib
=$ladir/$old_library
2554 if test "$linkmode,$pass" = "prog,link"; then
2555 compile_deplibs
="$deplib $compile_deplibs"
2556 finalize_deplibs
="$deplib $finalize_deplibs"
2558 deplibs
="$deplib $deplibs"
2559 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
2573 deplibs
="$deplib $deplibs"
2574 test "$pass" = conv
&& continue
2575 newdependency_libs
="$deplib $newdependency_libs"
2576 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2579 if test "$pass" = conv
; then
2580 deplibs
="$deplib $deplibs"
2583 if test "$pass" = scan
; then
2584 deplibs
="$deplib $deplibs"
2586 compile_deplibs
="$deplib $compile_deplibs"
2587 finalize_deplibs
="$deplib $finalize_deplibs"
2589 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2592 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2598 if test "$pass" = link
; then
2599 dir
=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2600 # Make sure the xrpath contains only unique directories.
2603 *) xrpath
="$xrpath $dir" ;;
2606 deplibs
="$deplib $deplibs"
2609 *.la
) lib
="$deplib" ;;
2611 if test "$pass" = conv
; then
2612 deplibs
="$deplib $deplibs"
2618 case $deplibs_check_method in
2620 set dummy
$deplibs_check_method
2621 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2622 if eval $echo \"$deplib\" 2>/dev
/null \
2624 |
$EGREP "$match_pattern_regex" > /dev
/null
; then
2632 if test "$valid_a_lib" != yes; then
2634 $echo "*** Warning: Trying to link with static lib archive $deplib."
2635 $echo "*** I have the capability to make that library automatically link in when"
2636 $echo "*** you link to this library. But I can only do this if you have a"
2637 $echo "*** shared version of the library, which you do not appear to have"
2638 $echo "*** because the file extensions .$libext of this argument makes me believe"
2639 $echo "*** that it is just a static archive that I should not used here."
2642 $echo "*** Warning: Linking the shared library $output against the"
2643 $echo "*** static library $deplib is not portable!"
2644 deplibs
="$deplib $deplibs"
2649 if test "$pass" != link
; then
2650 deplibs
="$deplib $deplibs"
2652 compile_deplibs
="$deplib $compile_deplibs"
2653 finalize_deplibs
="$deplib $finalize_deplibs"
2660 if test "$pass" = conv
; then
2661 deplibs
="$deplib $deplibs"
2662 elif test "$linkmode" = prog
; then
2663 if test "$pass" = dlpreopen ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
2664 # If there is no dlopen support or we're linking statically,
2665 # we need to preload.
2666 newdlprefiles
="$newdlprefiles $deplib"
2667 compile_deplibs
="$deplib $compile_deplibs"
2668 finalize_deplibs
="$deplib $finalize_deplibs"
2670 newdlfiles
="$newdlfiles $deplib"
2680 if test "$found" = yes ||
test -f "$lib"; then :
2682 $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
2686 # Check to see that this really is a libtool archive.
2687 if (${SED} -e '2q' $lib |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
2689 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2693 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2694 test "X$ladir" = "X$lib" && ladir
="."
2702 # If the library was installed with an old release of libtool,
2703 # it will not redefine variables installed, or shouldnotlink
2711 */* |
*\\*) .
$lib ;;
2715 if test "$linkmode,$pass" = "lib,link" ||
2716 test "$linkmode,$pass" = "prog,scan" ||
2717 { test "$linkmode" != prog
&& test "$linkmode" != lib
; }; then
2718 test -n "$dlopen" && dlfiles
="$dlfiles $dlopen"
2719 test -n "$dlpreopen" && dlprefiles
="$dlprefiles $dlpreopen"
2722 if test "$pass" = conv
; then
2723 # Only check for convenience libraries
2724 deplibs
="$lib $deplibs"
2725 if test -z "$libdir"; then
2726 if test -z "$old_library"; then
2727 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2730 # It is a libtool convenience library, so add in its objects.
2731 convenience
="$convenience $ladir/$objdir/$old_library"
2732 old_convenience
="$old_convenience $ladir/$objdir/$old_library"
2734 for deplib
in $dependency_libs; do
2735 deplibs
="$deplib $deplibs"
2736 if test "X$duplicate_deps" = "Xyes" ; then
2737 case "$tmp_libs " in
2738 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2741 tmp_libs
="$tmp_libs $deplib"
2743 elif test "$linkmode" != prog
&& test "$linkmode" != lib
; then
2744 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2751 # Get the name of the library we link against.
2753 for l
in $old_library $library_names; do
2756 if test -z "$linklib"; then
2757 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2761 # This library was specified with -dlopen.
2762 if test "$pass" = dlopen
; then
2763 if test -z "$libdir"; then
2764 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2767 if test -z "$dlname" ||
2768 test "$dlopen_support" != yes ||
2769 test "$build_libtool_libs" = no
; then
2770 # If there is no dlname, no dlopen support or we're linking
2771 # statically, we need to preload. We also need to preload any
2772 # dependent libraries so libltdl's deplib preloader doesn't
2773 # bomb out in the load deplibs phase.
2774 dlprefiles
="$dlprefiles $lib $dependency_libs"
2776 newdlfiles
="$newdlfiles $lib"
2781 # We need an absolute path.
2783 [\\/]* |
[A-Za-z
]:[\\/]*) abs_ladir
="$ladir" ;;
2785 abs_ladir
=`cd "$ladir" && pwd`
2786 if test -z "$abs_ladir"; then
2787 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2788 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2793 laname
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2795 # Find the relevant object directory and library name.
2796 if test "X$installed" = Xyes
; then
2797 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2798 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2806 test "X$hardcode_automatic" = Xyes
&& avoidtemprpath
=yes
2808 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2811 # Remove this search path later
2812 notinst_path
="$notinst_path $abs_ladir"
2814 dir
="$ladir/$objdir"
2815 absdir
="$abs_ladir/$objdir"
2816 # Remove this search path later
2817 notinst_path
="$notinst_path $abs_ladir"
2819 fi # $installed = yes
2820 name
=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2822 # This library was specified with -dlpreopen.
2823 if test "$pass" = dlpreopen
; then
2824 if test -z "$libdir"; then
2825 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2828 # Prefer using a static library (so that no silly _DYNAMIC symbols
2829 # are required to link).
2830 if test -n "$old_library"; then
2831 newdlprefiles
="$newdlprefiles $dir/$old_library"
2832 # Otherwise, use the dlname, so that lt_dlopen finds it.
2833 elif test -n "$dlname"; then
2834 newdlprefiles
="$newdlprefiles $dir/$dlname"
2836 newdlprefiles
="$newdlprefiles $dir/$linklib"
2838 fi # $pass = dlpreopen
2840 if test -z "$libdir"; then
2841 # Link the convenience library
2842 if test "$linkmode" = lib
; then
2843 deplibs
="$dir/$old_library $deplibs"
2844 elif test "$linkmode,$pass" = "prog,link"; then
2845 compile_deplibs
="$dir/$old_library $compile_deplibs"
2846 finalize_deplibs
="$dir/$old_library $finalize_deplibs"
2848 deplibs
="$lib $deplibs" # used for prog,scan pass
2854 if test "$linkmode" = prog
&& test "$pass" != link
; then
2855 newlib_search_path
="$newlib_search_path $ladir"
2856 deplibs
="$lib $deplibs"
2859 if test "$link_all_deplibs" != no ||
test -z "$library_names" ||
2860 test "$build_libtool_libs" = no
; then
2865 for deplib
in $dependency_libs; do
2867 -L*) newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2869 # Need to link against all dependency_libs?
2870 if test "$linkalldeplibs" = yes; then
2871 deplibs
="$deplib $deplibs"
2873 # Need to hardcode shared library paths
2874 # or/and link against static libraries
2875 newdependency_libs
="$deplib $newdependency_libs"
2877 if test "X$duplicate_deps" = "Xyes" ; then
2878 case "$tmp_libs " in
2879 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2882 tmp_libs
="$tmp_libs $deplib"
2885 fi # $linkmode = prog...
2887 if test "$linkmode,$pass" = "prog,link"; then
2888 if test -n "$library_names" &&
2889 { { test "$prefer_static_libs" = no ||
2890 test "$prefer_static_libs,$installed" = "built,yes"; } ||
2891 test -z "$old_library"; }; then
2892 # We need to hardcode the library path
2893 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2894 # Make sure the rpath contains only unique directories.
2895 case "$temp_rpath " in
2898 *) temp_rpath
="$temp_rpath $absdir" ;;
2902 # Hardcode the library path.
2903 # Skip directories that are in the system default run-time
2905 case " $sys_lib_dlsearch_path " in
2908 case "$compile_rpath " in
2910 *) compile_rpath
="$compile_rpath $absdir"
2914 case " $sys_lib_dlsearch_path " in
2917 case "$finalize_rpath " in
2919 *) finalize_rpath
="$finalize_rpath $libdir"
2923 fi # $linkmode,$pass = prog,link...
2925 if test "$alldeplibs" = yes &&
2926 { test "$deplibs_check_method" = pass_all ||
2927 { test "$build_libtool_libs" = yes &&
2928 test -n "$library_names"; }; }; then
2929 # We only need to search for static libraries
2934 link_static
=no
# Whether the deplib will be linked statically
2935 use_static_libs
=$prefer_static_libs
2936 if test "$use_static_libs" = built
&& test "$installed" = yes ; then
2939 if test -n "$library_names" &&
2940 { test "$use_static_libs" = no ||
test -z "$old_library"; }; then
2941 if test "$installed" = no
; then
2942 notinst_deplibs
="$notinst_deplibs $lib"
2945 # This is a shared library
2947 # Warn about portability, can't link against -module's on
2948 # some systems (darwin)
2949 if test "$shouldnotlink" = yes && test "$pass" = link
; then
2951 if test "$linkmode" = prog
; then
2952 $echo "*** Warning: Linking the executable $output against the loadable module"
2954 $echo "*** Warning: Linking the shared library $output against the loadable module"
2956 $echo "*** $linklib is not portable!"
2958 if test "$linkmode" = lib
&&
2959 test "$hardcode_into_libs" = yes; then
2960 # Hardcode the library path.
2961 # Skip directories that are in the system default run-time
2963 case " $sys_lib_dlsearch_path " in
2966 case "$compile_rpath " in
2968 *) compile_rpath
="$compile_rpath $absdir"
2972 case " $sys_lib_dlsearch_path " in
2975 case "$finalize_rpath " in
2977 *) finalize_rpath
="$finalize_rpath $libdir"
2983 if test -n "$old_archive_from_expsyms_cmds"; then
2984 # figure out the soname
2985 set dummy
$library_names
2988 libname
=`eval \\$echo \"$libname_spec\"`
2989 # use dlname if we got it. it's perfectly good, no?
2990 if test -n "$dlname"; then
2992 elif test -n "$soname_spec"; then
2996 major
=`expr $current - $age`
3000 eval soname
=\"$soname_spec\"
3005 # Make a new name for the extract_expsyms_cmds to use
3007 soname
=`$echo $soroot | ${SED} -e 's/^.*\///'`
3008 newlib
="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
3010 # If the library has no export list, then create one now
3011 if test -f "$output_objdir/$soname-def"; then :
3013 $show "extracting exported symbol list from \`$soname'"
3014 save_ifs
="$IFS"; IFS
='~'
3015 cmds
=$extract_expsyms_cmds
3016 for cmd
in $cmds; do
3020 $run eval "$cmd" ||
exit $?
3026 if test -f "$output_objdir/$newlib"; then :; else
3027 $show "generating import library for \`$soname'"
3028 save_ifs
="$IFS"; IFS
='~'
3029 cmds
=$old_archive_from_expsyms_cmds
3030 for cmd
in $cmds; do
3034 $run eval "$cmd" ||
exit $?
3038 # make sure the library variables are pointing to the new library
3041 fi # test -n "$old_archive_from_expsyms_cmds"
3043 if test "$linkmode" = prog ||
test "$mode" != relink
; then
3048 case $hardcode_action in
3049 immediate | unsupported
)
3050 if test "$hardcode_direct" = no
; then
3053 *-*-sco3.2v5.0.
[024]*) add_dir
="-L$dir" ;;
3054 *-*-sysv4*uw2
*) add_dir
="-L$dir" ;;
3055 *-*-sysv5OpenUNIX* |
*-*-sysv5UnixWare7.
[01].
[10]* | \
3056 *-*-unixware7*) add_dir
="-L$dir" ;;
3058 # if the lib is a module then we can not link against
3059 # it, someone is ignoring the new warnings I added
3060 if /usr
/bin
/file -L $add 2> /dev
/null |
3061 $EGREP ": [^:]* bundle" >/dev
/null
; then
3062 $echo "** Warning, lib $linklib is a module, not a shared library"
3063 if test -z "$old_library" ; then
3065 $echo "** And there doesn't seem to be a static archive available"
3066 $echo "** The link will probably fail, sorry"
3068 add
="$dir/$old_library"
3072 elif test "$hardcode_minus_L" = no
; then
3074 *-*-sunos*) add_shlibpath
="$dir" ;;
3078 elif test "$hardcode_shlibpath_var" = no
; then
3079 add_shlibpath
="$dir"
3086 if test "$hardcode_direct" = yes; then
3088 elif test "$hardcode_minus_L" = yes; then
3090 # Try looking first in the location we're being installed to.
3091 if test -n "$inst_prefix_dir"; then
3094 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
3099 elif test "$hardcode_shlibpath_var" = yes; then
3100 add_shlibpath
="$dir"
3109 if test "$lib_linked" != yes; then
3110 $echo "$modename: configuration error: unsupported hardcode properties"
3114 if test -n "$add_shlibpath"; then
3115 case :$compile_shlibpath: in
3116 *":$add_shlibpath:"*) ;;
3117 *) compile_shlibpath
="$compile_shlibpath$add_shlibpath:" ;;
3120 if test "$linkmode" = prog
; then
3121 test -n "$add_dir" && compile_deplibs
="$add_dir $compile_deplibs"
3122 test -n "$add" && compile_deplibs
="$add $compile_deplibs"
3124 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
3125 test -n "$add" && deplibs
="$add $deplibs"
3126 if test "$hardcode_direct" != yes && \
3127 test "$hardcode_minus_L" != yes && \
3128 test "$hardcode_shlibpath_var" = yes; then
3129 case :$finalize_shlibpath: in
3131 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
3137 if test "$linkmode" = prog ||
test "$mode" = relink
; then
3141 # Finalize command for both is simple: just hardcode it.
3142 if test "$hardcode_direct" = yes; then
3143 add
="$libdir/$linklib"
3144 elif test "$hardcode_minus_L" = yes; then
3147 elif test "$hardcode_shlibpath_var" = yes; then
3148 case :$finalize_shlibpath: in
3150 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
3153 elif test "$hardcode_automatic" = yes; then
3154 if test -n "$inst_prefix_dir" &&
3155 test -f "$inst_prefix_dir$libdir/$linklib" ; then
3156 add
="$inst_prefix_dir$libdir/$linklib"
3158 add
="$libdir/$linklib"
3161 # We cannot seem to hardcode it, guess we'll fake it.
3163 # Try looking first in the location we're being installed to.
3164 if test -n "$inst_prefix_dir"; then
3167 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
3174 if test "$linkmode" = prog
; then
3175 test -n "$add_dir" && finalize_deplibs
="$add_dir $finalize_deplibs"
3176 test -n "$add" && finalize_deplibs
="$add $finalize_deplibs"
3178 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
3179 test -n "$add" && deplibs
="$add $deplibs"
3182 elif test "$linkmode" = prog
; then
3183 # Here we assume that one of hardcode_direct or hardcode_minus_L
3184 # is not unsupported. This is valid on all known static and
3186 if test "$hardcode_direct" != unsupported
; then
3187 test -n "$old_library" && linklib
="$old_library"
3188 compile_deplibs
="$dir/$linklib $compile_deplibs"
3189 finalize_deplibs
="$dir/$linklib $finalize_deplibs"
3191 compile_deplibs
="-l$name -L$dir $compile_deplibs"
3192 finalize_deplibs
="-l$name -L$dir $finalize_deplibs"
3194 elif test "$build_libtool_libs" = yes; then
3195 # Not a shared library
3196 if test "$deplibs_check_method" != pass_all
; then
3197 # We're trying link a shared library against a static one
3198 # but the system doesn't support it.
3200 # Just print a warning and add the library to dependency_libs so
3201 # that the program can be linked against the static library.
3203 $echo "*** Warning: This system can not link to static lib archive $lib."
3204 $echo "*** I have the capability to make that library automatically link in when"
3205 $echo "*** you link to this library. But I can only do this if you have a"
3206 $echo "*** shared version of the library, which you do not appear to have."
3207 if test "$module" = yes; then
3208 $echo "*** But as you try to build a module library, libtool will still create "
3209 $echo "*** a static module, that should work as long as the dlopening application"
3210 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
3211 if test -z "$global_symbol_pipe"; then
3213 $echo "*** However, this would only work if libtool was able to extract symbol"
3214 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3215 $echo "*** not find such a program. So, this module is probably useless."
3216 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3218 if test "$build_old_libs" = no
; then
3219 build_libtool_libs
=module
3222 build_libtool_libs
=no
3226 deplibs
="$dir/$old_library $deplibs"
3229 fi # link shared/static library?
3231 if test "$linkmode" = lib
; then
3232 if test -n "$dependency_libs" &&
3233 { test "$hardcode_into_libs" != yes ||
3234 test "$build_old_libs" = yes ||
3235 test "$link_static" = yes; }; then
3236 # Extract -R from dependency_libs
3238 for libdir
in $dependency_libs; do
3240 -R*) temp_xrpath
=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
3242 *" $temp_xrpath "*) ;;
3243 *) xrpath
="$xrpath $temp_xrpath";;
3245 *) temp_deplibs
="$temp_deplibs $libdir";;
3248 dependency_libs
="$temp_deplibs"
3251 newlib_search_path
="$newlib_search_path $absdir"
3252 # Link against this library
3253 test "$link_static" = no
&& newdependency_libs
="$abs_ladir/$laname $newdependency_libs"
3254 # ... and its dependency_libs
3256 for deplib
in $dependency_libs; do
3257 newdependency_libs
="$deplib $newdependency_libs"
3258 if test "X$duplicate_deps" = "Xyes" ; then
3259 case "$tmp_libs " in
3260 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
3263 tmp_libs
="$tmp_libs $deplib"
3266 if test "$link_all_deplibs" != no
; then
3267 # Add the search paths of all dependency libraries
3268 for deplib
in $dependency_libs; do
3270 -L*) path
="$deplib" ;;
3272 dir
=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
3273 test "X$dir" = "X$deplib" && dir
="."
3274 # We need an absolute path.
3276 [\\/]* |
[A-Za-z
]:[\\/]*) absdir
="$dir" ;;
3278 absdir
=`cd "$dir" && pwd`
3279 if test -z "$absdir"; then
3280 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
3285 if grep "^installed=no" $deplib > /dev
/null
; then
3286 path
="$absdir/$objdir"
3288 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3289 if test -z "$libdir"; then
3290 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3293 if test "$absdir" != "$libdir"; then
3294 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
3301 # we do not want to link against static libs,
3302 # but need to link against shared
3303 eval deplibrary_names
=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
3304 if test -n "$deplibrary_names" ; then
3305 for tmp
in $deplibrary_names ; do
3308 if test -f "$path/$depdepl" ; then
3309 depdepl
="$path/$depdepl"
3311 # do not add paths which are already there
3312 case " $newlib_search_path " in
3314 *) newlib_search_path
="$newlib_search_path $path";;
3327 # Again, we only want to link against shared libraries
3328 eval tmp_libs
=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
3329 for tmp
in $newlib_search_path ; do
3330 if test -f "$tmp/lib$tmp_libs.dylib" ; then
3331 eval depdepl
="$tmp/lib$tmp_libs.dylib"
3342 case " $deplibs " in
3344 *) deplibs
="$path $deplibs" ;;
3346 case " $deplibs " in
3348 *) deplibs
="$depdepl $deplibs" ;;
3351 fi # link_all_deplibs != no
3353 done # for deplib in $libs
3354 dependency_libs
="$newdependency_libs"
3355 if test "$pass" = dlpreopen
; then
3356 # Link the dlpreopened libraries before other libraries
3357 for deplib
in $save_deplibs; do
3358 deplibs
="$deplib $deplibs"
3361 if test "$pass" != dlopen
; then
3362 if test "$pass" != conv
; then
3363 # Make sure lib_search_path contains only unique directories.
3365 for dir
in $newlib_search_path; do
3366 case "$lib_search_path " in
3368 *) lib_search_path
="$lib_search_path $dir" ;;
3374 if test "$linkmode,$pass" != "prog,link"; then
3377 vars
="compile_deplibs finalize_deplibs"
3379 for var
in $vars dependency_libs
; do
3380 # Add libraries to $var in reverse order
3381 eval tmp_libs
=\"\$
$var\"
3383 for deplib
in $tmp_libs; do
3384 # FIXME: Pedantically, this is the right thing to do, so
3385 # that some nasty dependency loop isn't accidentally
3387 #new_libs="$deplib $new_libs"
3388 # Pragmatically, this seems to cause very few problems in
3391 -L*) new_libs
="$deplib $new_libs" ;;
3394 # And here is the reason: when a library appears more
3395 # than once as an explicit dependence of a library, or
3396 # is implicitly linked in more than once by the
3397 # compiler, it is considered special, and multiple
3398 # occurrences thereof are not removed. Compare this
3399 # with having the same library being listed as a
3400 # dependency of multiple other libraries: in this case,
3401 # we know (pedantically, we assume) the library does not
3402 # need to be listed more than once, so we keep only the
3403 # last copy. This is not always right, but it is rare
3404 # enough that we require users that really mean to play
3405 # such unportable linking tricks to link the library
3406 # using -Wl,-lname, so that libtool does not consider it
3407 # for duplicate removal.
3408 case " $specialdeplibs " in
3409 *" $deplib "*) new_libs
="$deplib $new_libs" ;;
3411 case " $new_libs " in
3413 *) new_libs
="$deplib $new_libs" ;;
3421 for deplib
in $new_libs; do
3424 case " $tmp_libs " in
3426 *) tmp_libs
="$tmp_libs $deplib" ;;
3429 *) tmp_libs
="$tmp_libs $deplib" ;;
3432 eval $var=\"$tmp_libs\"
3435 # Last step: remove runtime libs from dependency_libs
3436 # (they stay in deplibs)
3438 for i
in $dependency_libs ; do
3439 case " $predeps $postdeps $compiler_lib_search_path " in
3444 if test -n "$i" ; then
3445 tmp_libs
="$tmp_libs $i"
3448 dependency_libs
=$tmp_libs
3450 if test "$linkmode" = prog
; then
3451 dlfiles
="$newdlfiles"
3452 dlprefiles
="$newdlprefiles"
3457 if test -n "$deplibs"; then
3458 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
3461 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3462 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3465 if test -n "$rpath"; then
3466 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3469 if test -n "$xrpath"; then
3470 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3473 if test -n "$vinfo"; then
3474 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3477 if test -n "$release"; then
3478 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3481 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
3482 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3485 # Now set the variables for building old libraries.
3486 build_libtool_libs
=no
3488 objs
="$objs$old_deplibs"
3492 # Make sure we only generate libraries of the form `libNAME.la'.
3495 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3496 eval shared_ext
=\"$shrext_cmds\"
3497 eval libname
=\"$libname_spec\"
3500 if test "$module" = no
; then
3501 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3505 if test "$need_lib_prefix" != no
; then
3506 # Add the "lib" prefix for modules if required
3507 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3508 eval shared_ext
=\"$shrext_cmds\"
3509 eval libname
=\"$libname_spec\"
3511 libname
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3516 if test -n "$objs"; then
3517 if test "$deplibs_check_method" != pass_all
; then
3518 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3522 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3523 $echo "*** objects $objs is not portable!"
3524 libobjs
="$libobjs $objs"
3528 if test "$dlself" != no
; then
3529 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3533 if test "$#" -gt 2; then
3534 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3539 if test -z "$rpath"; then
3540 if test "$build_libtool_libs" = yes; then
3541 # Building a libtool convenience library.
3542 # Some compilers have problems with a `.al' extension so
3543 # convenience libraries should have the same extension an
3544 # archive normally would.
3545 oldlibs
="$output_objdir/$libname.$libext $oldlibs"
3546 build_libtool_libs
=convenience
3550 if test -n "$vinfo"; then
3551 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3554 if test -n "$release"; then
3555 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3559 # Parse the version information argument.
3560 save_ifs
="$IFS"; IFS
=':'
3561 set dummy
$vinfo 0 0 0
3564 if test -n "$8"; then
3565 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3570 # convert absolute version numbers to libtool ages
3571 # this retains compatibility with .la files and attempts
3572 # to make the code below a bit more comprehensible
3574 case $vinfo_number in
3578 number_revision
="$4"
3580 # There are really only two kinds -- those that
3581 # use the current revision as the major version
3582 # and those that subtract age and use age as
3583 # a minor version. But, then there is irix
3584 # which has an extra 1 added just for fun
3586 case $version_type in
3587 darwin|linux|osf|windows|none
)
3588 current
=`expr $number_major + $number_minor`
3590 revision
="$number_revision"
3592 freebsd-aout|freebsd-elf|sunos
)
3593 current
="$number_major"
3594 revision
="$number_minor"
3598 current
=`expr $number_major + $number_minor`
3600 revision
="$number_minor"
3601 lt_irix_increment
=no
3612 # Check that each of the things are valid numbers.
3614 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]) ;;
3616 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3617 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3623 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]) ;;
3625 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3626 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3632 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]) ;;
3634 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3635 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3640 if test "$age" -gt "$current"; then
3641 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3642 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3646 # Calculate the version variables.
3650 case $version_type in
3654 # Like Linux, but with the current version available in
3655 # verstring for coding it into the library header
3656 major
=.
`expr $current - $age`
3657 versuffix
="$major.$age.$revision"
3658 # Darwin ld doesn't like 0 for these options...
3659 minor_current
=`expr $current + 1`
3660 xlcverstring
="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3661 verstring
="-compatibility_version $minor_current -current_version $minor_current.$revision"
3666 versuffix
=".$current.$revision";
3671 versuffix
=".$current";
3675 if test "X$lt_irix_increment" = "Xno"; then
3676 major
=`expr $current - $age`
3678 major
=`expr $current - $age + 1`
3680 case $version_type in
3681 nonstopux
) verstring_prefix
=nonstopux
;;
3682 *) verstring_prefix
=sgi
;;
3684 verstring
="$verstring_prefix$major.$revision"
3686 # Add in all the interfaces that we are compatible with.
3688 while test "$loop" -ne 0; do
3689 iface
=`expr $revision - $loop`
3690 loop
=`expr $loop - 1`
3691 verstring
="$verstring_prefix$major.$iface:$verstring"
3694 # Before this point, $major must not contain `.'.
3696 versuffix
="$major.$revision"
3700 major
=.
`expr $current - $age`
3701 versuffix
="$major.$age.$revision"
3705 major
=.
`expr $current - $age`
3706 versuffix
=".$current.$age.$revision"
3707 verstring
="$current.$age.$revision"
3709 # Add in all the interfaces that we are compatible with.
3711 while test "$loop" -ne 0; do
3712 iface
=`expr $current - $loop`
3713 loop
=`expr $loop - 1`
3714 verstring
="$verstring:${iface}.0"
3717 # Make executables depend on our current version.
3718 verstring
="$verstring:${current}.0"
3723 versuffix
=".$current.$revision"
3727 # Use '-' rather than '.', since we only want one
3728 # extension on DOS 8.3 filesystems.
3729 major
=`expr $current - $age`
3734 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3735 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3740 # Clear the version info if we defaulted, and they specified a release.
3741 if test -z "$vinfo" && test -n "$release"; then
3743 case $version_type in
3745 # we can't check for "0.0" in archive_cmds due to quoting
3746 # problems, so we reset it completely
3753 if test "$need_version" = no
; then
3760 # Remove version info from name if versioning should be avoided
3761 if test "$avoid_version" = yes && test "$need_version" = no
; then
3767 # Check to see if the archive will have undefined symbols.
3768 if test "$allow_undefined" = yes; then
3769 if test "$allow_undefined_flag" = unsupported
; then
3770 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3771 build_libtool_libs
=no
3775 # Don't allow undefined symbols.
3776 allow_undefined_flag
="$no_undefined_flag"
3780 if test "$mode" != relink
; then
3781 # Remove our outputs, but don't remove object files since they
3782 # may have been created when compiling PIC objects.
3784 tempremovelist
=`$echo "$output_objdir/*"`
3785 for p
in $tempremovelist; do
3789 $output_objdir/$outputname |
$output_objdir/$libname.
* |
$output_objdir/${libname}${release}.
*)
3790 if test "X$precious_files_regex" != "X"; then
3791 if echo $p |
$EGREP -e "$precious_files_regex" >/dev
/null
2>&1
3796 removelist
="$removelist $p"
3801 if test -n "$removelist"; then
3802 $show "${rm}r $removelist"
3803 $run ${rm}r
$removelist
3807 # Now set the variables for building old libraries.
3808 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience
; then
3809 oldlibs
="$oldlibs $output_objdir/$libname.$libext"
3811 # Transform .lo files to .o files.
3812 oldobjs
="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3815 # Eliminate all temporary directories.
3816 #for path in $notinst_path; do
3817 # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
3818 # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
3819 # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
3822 if test -n "$xrpath"; then
3823 # If the user specified any rpath flags, then add them.
3825 for libdir
in $xrpath; do
3826 temp_xrpath
="$temp_xrpath -R$libdir"
3827 case "$finalize_rpath " in
3829 *) finalize_rpath
="$finalize_rpath $libdir" ;;
3832 if test "$hardcode_into_libs" != yes ||
test "$build_old_libs" = yes; then
3833 dependency_libs
="$temp_xrpath $dependency_libs"
3837 # Make sure dlfiles contains only unique files that won't be dlpreopened
3838 old_dlfiles
="$dlfiles"
3840 for lib
in $old_dlfiles; do
3841 case " $dlprefiles $dlfiles " in
3843 *) dlfiles
="$dlfiles $lib" ;;
3847 # Make sure dlprefiles contains only unique files
3848 old_dlprefiles
="$dlprefiles"
3850 for lib
in $old_dlprefiles; do
3851 case "$dlprefiles " in
3853 *) dlprefiles
="$dlprefiles $lib" ;;
3857 if test "$build_libtool_libs" = yes; then
3858 if test -n "$rpath"; then
3860 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2* |
*-*-beos*)
3861 # these systems don't actually have a c library (as such)!
3863 *-*-rhapsody* |
*-*-darwin1.
[012])
3864 # Rhapsody C library is in the System framework
3865 deplibs
="$deplibs -framework System"
3868 # Don't link with libc until the a.out ld.so is fixed.
3870 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
3871 # Do not include libc due to us having libc/libc_r.
3873 *-*-sco3.2v5
* |
*-*-sco5v6*)
3874 # Causes problems with __ctype
3876 *-*-sysv4.2uw2
* |
*-*-sysv5* |
*-*-unixware* |
*-*-OpenUNIX*)
3877 # Compiler inserts libc in the correct place for threads to work
3880 # Add libc to deplibs on all other systems if necessary.
3881 if test "$build_libtool_need_lc" = "yes"; then
3882 deplibs
="$deplibs -lc"
3888 # Transform deplibs into only deplibs that can be linked in shared.
3890 libname_save
=$libname
3891 release_save
=$release
3892 versuffix_save
=$versuffix
3894 # I'm not sure if I'm treating the release correctly. I think
3895 # release should show up in the -l (ie -lgmp5) so we don't want to
3896 # add it in twice. Is that correct?
3902 case $deplibs_check_method in
3904 # Don't check for shared/static. Everything works.
3905 # This might be a little naive. We might want to check
3906 # whether the library exists or not. But this is on
3907 # osf3 & osf4 and I'm not really sure... Just
3908 # implementing what was already the behavior.
3912 # This code stresses the "libraries are programs" paradigm to its
3913 # limits. Maybe even breaks it. We compile a program, linking it
3914 # against the deplibs as a proxy for the library. Then we can check
3915 # whether they linked in statically or dynamically with ldd.
3917 cat > conftest.c
<<EOF
3918 int main() { return 0; }
3921 if $LTCC $LTCFLAGS -o conftest conftest.c
$deplibs; then
3922 ldd_output
=`ldd conftest`
3923 for i
in $deplibs; do
3924 name
=`expr $i : '-l\(.*\)'`
3925 # If $name is empty we are operating on a -L argument.
3926 if test "$name" != "" && test "$name" != "0"; then
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 I believe you do not have"
3949 $echo "*** because a test_compile did reveal that the linker did not use it for"
3950 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3954 newdeplibs
="$newdeplibs $i"
3958 # Error occurred in the first compile. Let's try to salvage
3959 # the situation: Compile a separate program for each library.
3960 for i
in $deplibs; do
3961 name
=`expr $i : '-l\(.*\)'`
3962 # If $name is empty we are operating on a -L argument.
3963 if test "$name" != "" && test "$name" != "0"; then
3965 if $LTCC $LTCFLAGS -o conftest conftest.c
$i; then
3966 ldd_output
=`ldd conftest`
3967 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3968 case " $predeps $postdeps " in
3970 newdeplibs
="$newdeplibs $i"
3975 if test -n "$i" ; then
3976 libname
=`eval \\$echo \"$libname_spec\"`
3977 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
3978 set dummy
$deplib_matches
3980 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3981 newdeplibs
="$newdeplibs $i"
3985 $echo "*** Warning: dynamic linker does not accept needed library $i."
3986 $echo "*** I have the capability to make that library automatically link in when"
3987 $echo "*** you link to this library. But I can only do this if you have a"
3988 $echo "*** shared version of the library, which you do not appear to have"
3989 $echo "*** because a test_compile did reveal that the linker did not use this one"
3990 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3996 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3997 $echo "*** make it link in! You will probably need to install it or some"
3998 $echo "*** library that it depends on before this library will be fully"
3999 $echo "*** functional. Installing it before continuing would be even better."
4002 newdeplibs
="$newdeplibs $i"
4008 set dummy
$deplibs_check_method
4009 file_magic_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
4010 for a_deplib
in $deplibs; do
4011 name
=`expr $a_deplib : '-l\(.*\)'`
4012 # If $name is empty we are operating on a -L argument.
4013 if test "$name" != "" && test "$name" != "0"; then
4014 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4015 case " $predeps $postdeps " in
4017 newdeplibs
="$newdeplibs $a_deplib"
4022 if test -n "$a_deplib" ; then
4023 libname
=`eval \\$echo \"$libname_spec\"`
4024 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
4025 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
4026 for potent_lib
in $potential_libs; do
4027 # Follow soft links.
4028 if ls -lLd "$potent_lib" 2>/dev
/null \
4029 |
grep " -> " >/dev
/null
; then
4032 # The statement above tries to avoid entering an
4033 # endless loop below, in case of cyclic links.
4034 # We might still enter an endless loop, since a link
4035 # loop can be closed while we follow links,
4037 potlib
="$potent_lib"
4038 while test -h "$potlib" 2>/dev
/null
; do
4039 potliblink
=`ls -ld $potlib | ${SED} 's/.* -> //'`
4041 [\\/]* |
[A-Za-z
]:[\\/]*) potlib
="$potliblink";;
4042 *) potlib
=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
4045 if eval $file_magic_cmd \"\
$potlib\" 2>/dev
/null \
4047 |
$EGREP "$file_magic_regex" > /dev
/null
; then
4048 newdeplibs
="$newdeplibs $a_deplib"
4055 if test -n "$a_deplib" ; then
4058 $echo "*** Warning: linker path does not have real file for library $a_deplib."
4059 $echo "*** I have the capability to make that library automatically link in when"
4060 $echo "*** you link to this library. But I can only do this if you have a"
4061 $echo "*** shared version of the library, which you do not appear to have"
4062 $echo "*** because I did check the linker path looking for a file starting"
4063 if test -z "$potlib" ; then
4064 $echo "*** with $libname but no candidates were found. (...for file magic test)"
4066 $echo "*** with $libname and none of the candidates passed a file format test"
4067 $echo "*** using a file magic. Last file checked: $potlib"
4071 # Add a -L argument.
4072 newdeplibs
="$newdeplibs $a_deplib"
4074 done # Gone through all deplibs.
4077 set dummy
$deplibs_check_method
4078 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
4079 for a_deplib
in $deplibs; do
4080 name
=`expr $a_deplib : '-l\(.*\)'`
4081 # If $name is empty we are operating on a -L argument.
4082 if test -n "$name" && test "$name" != "0"; then
4083 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4084 case " $predeps $postdeps " in
4086 newdeplibs
="$newdeplibs $a_deplib"
4091 if test -n "$a_deplib" ; then
4092 libname
=`eval \\$echo \"$libname_spec\"`
4093 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
4094 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
4095 for potent_lib
in $potential_libs; do
4096 potlib
="$potent_lib" # see symlink-check above in file_magic test
4097 if eval $echo \"$potent_lib\" 2>/dev
/null \
4099 |
$EGREP "$match_pattern_regex" > /dev
/null
; then
4100 newdeplibs
="$newdeplibs $a_deplib"
4107 if test -n "$a_deplib" ; then
4110 $echo "*** Warning: linker path does not have real file for library $a_deplib."
4111 $echo "*** I have the capability to make that library automatically link in when"
4112 $echo "*** you link to this library. But I can only do this if you have a"
4113 $echo "*** shared version of the library, which you do not appear to have"
4114 $echo "*** because I did check the linker path looking for a file starting"
4115 if test -z "$potlib" ; then
4116 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
4118 $echo "*** with $libname and none of the candidates passed a file format test"
4119 $echo "*** using a regex pattern. Last file checked: $potlib"
4123 # Add a -L argument.
4124 newdeplibs
="$newdeplibs $a_deplib"
4126 done # Gone through all deplibs.
4130 tmp_deplibs
=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
4131 -e 's/ -[LR][^ ]*//g'`
4132 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4133 for i
in $predeps $postdeps ; do
4134 # can't use Xsed below, because $i might contain '/'
4135 tmp_deplibs
=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
4138 if $echo "X $tmp_deplibs" |
$Xsed -e 's/[ ]//g' \
4139 |
grep .
>/dev
/null
; then
4141 if test "X$deplibs_check_method" = "Xnone"; then
4142 $echo "*** Warning: inter-library dependencies are not supported in this platform."
4144 $echo "*** Warning: inter-library dependencies are not known to be supported."
4146 $echo "*** All declared inter-library dependencies are being dropped."
4151 versuffix
=$versuffix_save
4153 release
=$release_save
4154 libname
=$libname_save
4158 *-*-rhapsody* |
*-*-darwin1.
[012])
4159 # On Rhapsody replace the C library is the System framework
4160 newdeplibs
=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
4164 if test "$droppeddeps" = yes; then
4165 if test "$module" = yes; then
4167 $echo "*** Warning: libtool could not satisfy all declared inter-library"
4168 $echo "*** dependencies of module $libname. Therefore, libtool will create"
4169 $echo "*** a static module, that should work as long as the dlopening"
4170 $echo "*** application is linked with the -dlopen flag."
4171 if test -z "$global_symbol_pipe"; then
4173 $echo "*** However, this would only work if libtool was able to extract symbol"
4174 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
4175 $echo "*** not find such a program. So, this module is probably useless."
4176 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
4178 if test "$build_old_libs" = no
; then
4179 oldlibs
="$output_objdir/$libname.$libext"
4180 build_libtool_libs
=module
4183 build_libtool_libs
=no
4186 $echo "*** The inter-library dependencies that have been dropped here will be"
4187 $echo "*** automatically added whenever a program is linked with this library"
4188 $echo "*** or is declared to -dlopen it."
4190 if test "$allow_undefined" = no
; then
4192 $echo "*** Since this library must not contain undefined symbols,"
4193 $echo "*** because either the platform does not support them or"
4194 $echo "*** it was explicitly requested with -no-undefined,"
4195 $echo "*** libtool will only create a static version of it."
4196 if test "$build_old_libs" = no
; then
4197 oldlibs
="$output_objdir/$libname.$libext"
4198 build_libtool_libs
=module
4201 build_libtool_libs
=no
4206 # Done checking deplibs!
4211 # move library search paths that coincide with paths to not yet
4212 # installed libraries to the beginning of the library search list
4214 for path
in $notinst_path; do
4215 case " $new_libs " in
4216 *" -L$path/$objdir "*) ;;
4218 case " $deplibs " in
4219 *" -L$path/$objdir "*)
4220 new_libs
="$new_libs -L$path/$objdir" ;;
4225 for deplib
in $deplibs; do
4228 case " $new_libs " in
4230 *) new_libs
="$new_libs $deplib" ;;
4233 *) new_libs
="$new_libs $deplib" ;;
4239 # All the library-specific variables (install_libdir is set above).
4244 # Test again, we may have decided not to build it any more
4245 if test "$build_libtool_libs" = yes; then
4246 if test "$hardcode_into_libs" = yes; then
4247 # Hardcode the library paths
4250 rpath
="$finalize_rpath"
4251 test "$mode" != relink
&& rpath
="$compile_rpath$rpath"
4252 for libdir
in $rpath; do
4253 if test -n "$hardcode_libdir_flag_spec"; then
4254 if test -n "$hardcode_libdir_separator"; then
4255 if test -z "$hardcode_libdirs"; then
4256 hardcode_libdirs
="$libdir"
4258 # Just accumulate the unique libdirs.
4259 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4260 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4263 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4268 eval flag
=\"$hardcode_libdir_flag_spec\"
4269 dep_rpath
="$dep_rpath $flag"
4271 elif test -n "$runpath_var"; then
4272 case "$perm_rpath " in
4274 *) perm_rpath
="$perm_rpath $libdir" ;;
4278 # Substitute the hardcoded libdirs into the rpath.
4279 if test -n "$hardcode_libdir_separator" &&
4280 test -n "$hardcode_libdirs"; then
4281 libdir
="$hardcode_libdirs"
4282 if test -n "$hardcode_libdir_flag_spec_ld"; then
4283 case $archive_cmds in
4284 *\
$LD*) eval dep_rpath
=\"$hardcode_libdir_flag_spec_ld\" ;;
4285 *) eval dep_rpath
=\"$hardcode_libdir_flag_spec\" ;;
4288 eval dep_rpath
=\"$hardcode_libdir_flag_spec\"
4291 if test -n "$runpath_var" && test -n "$perm_rpath"; then
4292 # We should set the runpath_var.
4294 for dir
in $perm_rpath; do
4297 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
4299 test -n "$dep_rpath" && deplibs
="$dep_rpath $deplibs"
4302 shlibpath
="$finalize_shlibpath"
4303 test "$mode" != relink
&& shlibpath
="$compile_shlibpath$shlibpath"
4304 if test -n "$shlibpath"; then
4305 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
4308 # Get the real and link names of the library.
4309 eval shared_ext
=\"$shrext_cmds\"
4310 eval library_names
=\"$library_names_spec\"
4311 set dummy
$library_names
4315 if test -n "$soname_spec"; then
4316 eval soname
=\"$soname_spec\"
4320 if test -z "$dlname"; then
4324 lib
="$output_objdir/$realname"
4328 linknames
="$linknames $link"
4331 # Use standard objects if they are pic
4332 test -z "$pic_flag" && libobjs
=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4334 # Prepare the list of exported symbols
4335 if test -z "$export_symbols"; then
4336 if test "$always_export_symbols" = yes ||
test -n "$export_symbols_regex"; then
4337 $show "generating symbol list for \`$libname.la'"
4338 export_symbols
="$output_objdir/$libname.exp"
4339 $run $rm $export_symbols
4340 cmds
=$export_symbols_cmds
4341 save_ifs
="$IFS"; IFS
='~'
4342 for cmd
in $cmds; do
4345 if len
=`expr "X$cmd" : ".*"` &&
4346 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
4348 $run eval "$cmd" ||
exit $?
4349 skipped_export
=false
4351 # The command line is too long to execute in one step.
4352 $show "using reloadable object file for export list..."
4354 # Break out early, otherwise skipped_export may be
4355 # set to false by a later but shorter cmd.
4360 if test -n "$export_symbols_regex"; then
4361 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
4362 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
4363 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
4364 $run eval '$mv "${export_symbols}T" "$export_symbols"'
4369 if test -n "$export_symbols" && test -n "$include_expsyms"; then
4370 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
4374 for test_deplib
in $deplibs; do
4375 case " $convenience " in
4376 *" $test_deplib "*) ;;
4378 tmp_deplibs
="$tmp_deplibs $test_deplib"
4382 deplibs
="$tmp_deplibs"
4384 if test -n "$convenience"; then
4385 if test -n "$whole_archive_flag_spec"; then
4386 save_libobjs
=$libobjs
4387 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
4389 gentop
="$output_objdir/${outputname}x"
4390 generated
="$generated $gentop"
4392 func_extract_archives
$gentop $convenience
4393 libobjs
="$libobjs $func_extract_archives_result"
4397 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
4398 eval flag
=\"$thread_safe_flag_spec\"
4399 linker_flags
="$linker_flags $flag"
4402 # Make a backup of the uninstalled library when relinking
4403 if test "$mode" = relink
; then
4404 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' ||
exit $?
4407 # Do each of the archive commands.
4408 if test "$module" = yes && test -n "$module_cmds" ; then
4409 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4410 eval test_cmds
=\"$module_expsym_cmds\"
4411 cmds
=$module_expsym_cmds
4413 eval test_cmds
=\"$module_cmds\"
4417 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4418 eval test_cmds
=\"$archive_expsym_cmds\"
4419 cmds
=$archive_expsym_cmds
4421 eval test_cmds
=\"$archive_cmds\"
4426 if test "X$skipped_export" != "X:" &&
4427 len
=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4428 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
4431 # The command line is too long to link in one step, link piecewise.
4432 $echo "creating reloadable object files..."
4434 # Save the value of $output and $libobjs because we want to
4435 # use them later. If we have whole_archive_flag_spec, we
4436 # want to use save_libobjs as it was before
4437 # whole_archive_flag_spec was expanded, because we can't
4438 # assume the linker understands whole_archive_flag_spec.
4439 # This may have to be revisited, in case too many
4440 # convenience libraries get linked in and end up exceeding
4442 if test -z "$convenience" ||
test -z "$whole_archive_flag_spec"; then
4443 save_libobjs
=$libobjs
4446 output_la
=`$echo "X$output" | $Xsed -e "$basename"`
4448 # Clear the reloadable object creation command queue and
4449 # initialize k to one.
4456 output
=$output_objdir/$output_la-${k}.
$objext
4457 # Loop over the list of objects to be linked.
4458 for obj
in $save_libobjs
4460 eval test_cmds
=\"$reload_cmds $objlist $last_robj\"
4461 if test "X$objlist" = X ||
4462 { len
=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4463 test "$len" -le "$max_cmd_len"; }; then
4464 objlist
="$objlist $obj"
4466 # The command $test_cmds is almost too long, add a
4467 # command to the queue.
4468 if test "$k" -eq 1 ; then
4469 # The first file doesn't have a previous command to add.
4470 eval concat_cmds
=\"$reload_cmds $objlist $last_robj\"
4472 # All subsequent reloadable object files will link in
4473 # the last one created.
4474 eval concat_cmds
=\"\
$concat_cmds~
$reload_cmds $objlist $last_robj\"
4476 last_robj
=$output_objdir/$output_la-${k}.
$objext
4478 output
=$output_objdir/$output_la-${k}.
$objext
4483 # Handle the remaining objects by creating one last
4484 # reloadable object file. All subsequent reloadable object
4485 # files will link in the last one created.
4486 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
4487 eval concat_cmds
=\"\
${concat_cmds}$reload_cmds $objlist $last_robj\"
4489 if ${skipped_export-false}; then
4490 $show "generating symbol list for \`$libname.la'"
4491 export_symbols
="$output_objdir/$libname.exp"
4492 $run $rm $export_symbols
4494 # Append the command to create the export file.
4495 eval concat_cmds
=\"\
$concat_cmds~
$export_symbols_cmds\"
4498 # Set up a command to remove the reloadable object files
4499 # after they are used.
4501 while test "$i" -lt "$k"
4504 delfiles
="$delfiles $output_objdir/$output_la-${i}.$objext"
4507 $echo "creating a temporary reloadable object file: $output"
4509 # Loop through the commands generated above and execute them.
4510 save_ifs
="$IFS"; IFS
='~'
4511 for cmd
in $concat_cmds; do
4514 $run eval "$cmd" ||
exit $?
4519 # Restore the value of output.
4522 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4523 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
4525 # Expand the library linking commands again to reset the
4526 # value of $libobjs for piecewise linking.
4528 # Do each of the archive commands.
4529 if test "$module" = yes && test -n "$module_cmds" ; then
4530 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4531 cmds
=$module_expsym_cmds
4536 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4537 cmds
=$archive_expsym_cmds
4543 # Append the command to remove the reloadable object files
4544 # to the just-reset $cmds.
4545 eval cmds
=\"\
$cmds~\
$rm $delfiles\"
4547 save_ifs
="$IFS"; IFS
='~'
4548 for cmd
in $cmds; do
4552 $run eval "$cmd" ||
{
4555 # Restore the uninstalled library and exit
4556 if test "$mode" = relink
; then
4557 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
4565 # Restore the uninstalled library and exit
4566 if test "$mode" = relink
; then
4567 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' ||
exit $?
4569 if test -n "$convenience"; then
4570 if test -z "$whole_archive_flag_spec"; then
4571 $show "${rm}r $gentop"
4572 $run ${rm}r
"$gentop"
4579 # Create links to the real library.
4580 for linkname
in $linknames; do
4581 if test "$realname" != "$linkname"; then
4582 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4583 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' ||
exit $?
4587 # If -module or -export-dynamic was specified, set the dlname.
4588 if test "$module" = yes ||
test "$export_dynamic" = yes; then
4589 # On all known operating systems, these are identical.
4596 if test -n "$deplibs"; then
4597 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4600 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
4601 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4604 if test -n "$rpath"; then
4605 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4608 if test -n "$xrpath"; then
4609 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4612 if test -n "$vinfo"; then
4613 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4616 if test -n "$release"; then
4617 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4622 if test -n "$objs$old_deplibs"; then
4623 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4627 obj
=`$echo "X$output" | $Xsed -e "$lo2o"`
4635 # Delete the old objects.
4636 $run $rm $obj $libobj
4638 # Objects from convenience libraries. This assumes
4639 # single-version convenience libraries. Whenever we create
4640 # different ones for PIC/non-PIC, this we'll have to duplicate
4644 # reload_cmds runs $LD directly, so let us get rid of
4645 # -Wl from whole_archive_flag_spec and hope we can get by with
4646 # turning comma into space..
4649 if test -n "$convenience"; then
4650 if test -n "$whole_archive_flag_spec"; then
4651 eval tmp_whole_archive_flags
=\"$whole_archive_flag_spec\"
4652 reload_conv_objs
=$reload_objs\
`$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
4654 gentop
="$output_objdir/${obj}x"
4655 generated
="$generated $gentop"
4657 func_extract_archives
$gentop $convenience
4658 reload_conv_objs
="$reload_objs $func_extract_archives_result"
4662 # Create the old-style object.
4663 reload_objs
="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
4667 save_ifs
="$IFS"; IFS
='~'
4668 for cmd
in $cmds; do
4672 $run eval "$cmd" ||
exit $?
4676 # Exit if we aren't doing a library object file.
4677 if test -z "$libobj"; then
4678 if test -n "$gentop"; then
4679 $show "${rm}r $gentop"
4686 if test "$build_libtool_libs" != yes; then
4687 if test -n "$gentop"; then
4688 $show "${rm}r $gentop"
4692 # Create an invalid libtool object if no PIC, so that we don't
4693 # accidentally link it into a program.
4694 # $show "echo timestamp > $libobj"
4695 # $run eval "echo timestamp > $libobj" || exit $?
4699 if test -n "$pic_flag" ||
test "$pic_mode" != default
; then
4700 # Only do commands if we really have different PIC objects.
4701 reload_objs
="$libobjs $reload_conv_objs"
4704 save_ifs
="$IFS"; IFS
='~'
4705 for cmd
in $cmds; do
4709 $run eval "$cmd" ||
exit $?
4714 if test -n "$gentop"; then
4715 $show "${rm}r $gentop"
4724 *cygwin
*) output
=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4726 if test -n "$vinfo"; then
4727 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4730 if test -n "$release"; then
4731 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4734 if test "$preload" = yes; then
4735 if test "$dlopen_support" = unknown
&& test "$dlopen_self" = unknown
&&
4736 test "$dlopen_self_static" = unknown
; then
4737 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4742 *-*-rhapsody* |
*-*-darwin1.
[012])
4743 # On Rhapsody replace the C library is the System framework
4744 compile_deplibs
=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4745 finalize_deplibs
=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4751 # Don't allow lazy linking, it breaks C++ global constructors
4752 if test "$tagname" = CXX
; then
4753 compile_command
="$compile_command ${wl}-bind_at_load"
4754 finalize_command
="$finalize_command ${wl}-bind_at_load"
4760 # move library search paths that coincide with paths to not yet
4761 # installed libraries to the beginning of the library search list
4763 for path
in $notinst_path; do
4764 case " $new_libs " in
4765 *" -L$path/$objdir "*) ;;
4767 case " $compile_deplibs " in
4768 *" -L$path/$objdir "*)
4769 new_libs
="$new_libs -L$path/$objdir" ;;
4774 for deplib
in $compile_deplibs; do
4777 case " $new_libs " in
4779 *) new_libs
="$new_libs $deplib" ;;
4782 *) new_libs
="$new_libs $deplib" ;;
4785 compile_deplibs
="$new_libs"
4788 compile_command
="$compile_command $compile_deplibs"
4789 finalize_command
="$finalize_command $finalize_deplibs"
4791 if test -n "$rpath$xrpath"; then
4792 # If the user specified any rpath flags, then add them.
4793 for libdir
in $rpath $xrpath; do
4794 # This is the magic to use -rpath.
4795 case "$finalize_rpath " in
4797 *) finalize_rpath
="$finalize_rpath $libdir" ;;
4802 # Now hardcode the library paths
4805 for libdir
in $compile_rpath $finalize_rpath; do
4806 if test -n "$hardcode_libdir_flag_spec"; then
4807 if test -n "$hardcode_libdir_separator"; then
4808 if test -z "$hardcode_libdirs"; then
4809 hardcode_libdirs
="$libdir"
4811 # Just accumulate the unique libdirs.
4812 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4813 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4816 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4821 eval flag
=\"$hardcode_libdir_flag_spec\"
4822 rpath
="$rpath $flag"
4824 elif test -n "$runpath_var"; then
4825 case "$perm_rpath " in
4827 *) perm_rpath
="$perm_rpath $libdir" ;;
4831 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
4832 testbindir
=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
4833 case :$dllsearchpath: in
4835 *) dllsearchpath
="$dllsearchpath:$libdir";;
4837 case :$dllsearchpath: in
4838 *":$testbindir:"*) ;;
4839 *) dllsearchpath
="$dllsearchpath:$testbindir";;
4844 # Substitute the hardcoded libdirs into the rpath.
4845 if test -n "$hardcode_libdir_separator" &&
4846 test -n "$hardcode_libdirs"; then
4847 libdir
="$hardcode_libdirs"
4848 eval rpath
=\" $hardcode_libdir_flag_spec\"
4850 compile_rpath
="$rpath"
4854 for libdir
in $finalize_rpath; do
4855 if test -n "$hardcode_libdir_flag_spec"; then
4856 if test -n "$hardcode_libdir_separator"; then
4857 if test -z "$hardcode_libdirs"; then
4858 hardcode_libdirs
="$libdir"
4860 # Just accumulate the unique libdirs.
4861 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4862 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4865 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4870 eval flag
=\"$hardcode_libdir_flag_spec\"
4871 rpath
="$rpath $flag"
4873 elif test -n "$runpath_var"; then
4874 case "$finalize_perm_rpath " in
4876 *) finalize_perm_rpath
="$finalize_perm_rpath $libdir" ;;
4880 # Substitute the hardcoded libdirs into the rpath.
4881 if test -n "$hardcode_libdir_separator" &&
4882 test -n "$hardcode_libdirs"; then
4883 libdir
="$hardcode_libdirs"
4884 eval rpath
=\" $hardcode_libdir_flag_spec\"
4886 finalize_rpath
="$rpath"
4888 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4889 # Transform all the library objects into standard objects.
4890 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4891 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4895 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
4896 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4897 dlsyms
="${outputname}S.c"
4899 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4903 if test -n "$dlsyms"; then
4907 # Discover the nlist of each of the dlfiles.
4908 nlist
="$output_objdir/${outputname}.nm"
4910 $show "$rm $nlist ${nlist}S ${nlist}T"
4911 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4913 # Parse the name list into a source file.
4914 $show "creating $output_objdir/$dlsyms"
4916 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4917 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4918 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4924 /* Prevent the only kind of declaration conflicts we can make. */
4925 #define lt_preloaded_symbols some_other_symbol
4927 /* External symbol declarations for the compiler. */\
4930 if test "$dlself" = yes; then
4931 $show "generating symbol list for \`$output'"
4933 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4935 # Add our own program objects to the symbol list.
4936 progfiles
=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4937 for arg
in $progfiles; do
4938 $show "extracting global C symbols from \`$arg'"
4939 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4942 if test -n "$exclude_expsyms"; then
4943 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4944 $run eval '$mv "$nlist"T "$nlist"'
4947 if test -n "$export_symbols_regex"; then
4948 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4949 $run eval '$mv "$nlist"T "$nlist"'
4952 # Prepare the list of exported symbols
4953 if test -z "$export_symbols"; then
4954 export_symbols
="$output_objdir/$outputname.exp"
4955 $run $rm $export_symbols
4956 $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4958 *cygwin
* |
*mingw
* )
4959 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4960 $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4964 $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4965 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4966 $run eval 'mv "$nlist"T "$nlist"'
4968 *cygwin
* |
*mingw
* )
4969 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4970 $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
4976 for arg
in $dlprefiles; do
4977 $show "extracting global C symbols from \`$arg'"
4978 name
=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4979 $run eval '$echo ": $name " >> "$nlist"'
4980 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4983 if test -z "$run"; then
4984 # Make sure we have at least an empty file.
4985 test -f "$nlist" ||
: > "$nlist"
4987 if test -n "$exclude_expsyms"; then
4988 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4989 $mv "$nlist"T
"$nlist"
4992 # Try sorting and uniquifying the output.
4993 if grep -v "^: " < "$nlist" |
4994 if sort -k 3 </dev
/null
>/dev
/null
2>&1; then
4999 uniq > "$nlist"S
; then
5002 grep -v "^: " < "$nlist" > "$nlist"S
5005 if test -f "$nlist"S
; then
5006 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
5008 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
5011 $echo >> "$output_objdir/$dlsyms" "\
5013 #undef lt_preloaded_symbols
5015 #if defined (__STDC__) && __STDC__
5016 # define lt_ptr void *
5018 # define lt_ptr char *
5022 /* The mapping between symbol names and symbols. */
5026 *cygwin
* |
*mingw
* )
5027 $echo >> "$output_objdir/$dlsyms" "\
5028 /* DATA imports from DLLs on WIN32 can't be const, because
5029 runtime relocations are performed -- see ld's documentation
5035 $echo >> "$output_objdir/$dlsyms" "\
5042 $echo >> "$output_objdir/$dlsyms" "\
5046 lt_preloaded_symbols[] =
5050 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
5052 $echo >> "$output_objdir/$dlsyms" "\
5056 /* This works around a problem in FreeBSD linker */
5057 #ifdef FREEBSD_WORKAROUND
5058 static const void *lt_preloaded_setup() {
5059 return lt_preloaded_symbols;
5069 pic_flag_for_symtable
=
5071 # compiling the symbol table file with pic_flag works around
5072 # a FreeBSD bug that causes programs to crash when -lm is
5073 # linked before any other PIC object. But we must not use
5074 # pic_flag when linking with -static. The problem exists in
5075 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
5076 *-*-freebsd2*|
*-*-freebsd3.0
*|
*-*-freebsdelf3.0
*)
5077 case "$compile_command " in
5079 *) pic_flag_for_symtable
=" $pic_flag -DFREEBSD_WORKAROUND";;
5082 case "$compile_command " in
5084 *) pic_flag_for_symtable
=" $pic_flag";;
5088 # Now compile the dynamic symbol file.
5089 $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
5090 $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' ||
exit $?
5092 # Clean up the generated files.
5093 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
5094 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
5096 # Transform the symbol file into the correct name.
5098 *cygwin
* |
*mingw
* )
5099 if test -f "$output_objdir/${outputname}.def" ; then
5100 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
5101 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
5103 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
5104 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
5108 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
5109 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
5114 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
5119 # We keep going just in case the user didn't refer to
5120 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
5121 # really was required.
5123 # Nullify the symbol file.
5124 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
5125 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
5128 if test "$need_relink" = no ||
test "$build_libtool_libs" != yes; then
5129 # Replace the output file specification.
5130 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
5131 link_command
="$compile_command$compile_rpath"
5133 # We have no uninstalled library dependencies, so finalize right now.
5134 $show "$link_command"
5135 $run eval "$link_command"
5138 # Delete the generated files.
5139 if test -n "$dlsyms"; then
5140 $show "$rm $output_objdir/${outputname}S.${objext}"
5141 $run $rm "$output_objdir/${outputname}S.${objext}"
5147 if test -n "$shlibpath_var"; then
5148 # We should set the shlibpath_var
5150 for dir
in $temp_rpath; do
5152 [\\/]* |
[A-Za-z
]:[\\/]*)
5157 # Relative path: add a thisdir entry.
5158 rpath
="$rpath\$thisdir/$dir:"
5165 if test -n "$compile_shlibpath$finalize_shlibpath"; then
5166 compile_command
="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
5168 if test -n "$finalize_shlibpath"; then
5169 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
5174 if test -n "$runpath_var"; then
5175 if test -n "$perm_rpath"; then
5176 # We should set the runpath_var.
5178 for dir
in $perm_rpath; do
5181 compile_var
="$runpath_var=\"$rpath\$$runpath_var\" "
5183 if test -n "$finalize_perm_rpath"; then
5184 # We should set the runpath_var.
5186 for dir
in $finalize_perm_rpath; do
5189 finalize_var
="$runpath_var=\"$rpath\$$runpath_var\" "
5193 if test "$no_install" = yes; then
5194 # We don't need to create a wrapper script.
5195 link_command
="$compile_var$compile_command$compile_rpath"
5196 # Replace the output file specification.
5197 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
5198 # Delete the old output file.
5200 # Link the executable and exit
5201 $show "$link_command"
5202 $run eval "$link_command" ||
exit $?
5206 if test "$hardcode_action" = relink
; then
5207 # Fast installation is not supported
5208 link_command
="$compile_var$compile_command$compile_rpath"
5209 relink_command
="$finalize_var$finalize_command$finalize_rpath"
5211 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
5212 $echo "$modename: \`$output' will be relinked during installation" 1>&2
5214 if test "$fast_install" != no
; then
5215 link_command
="$finalize_var$compile_command$finalize_rpath"
5216 if test "$fast_install" = yes; then
5217 relink_command
=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
5219 # fast_install is set to needless
5223 link_command
="$compile_var$compile_command$compile_rpath"
5224 relink_command
="$finalize_var$finalize_command$finalize_rpath"
5228 # Replace the output file specification.
5229 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
5231 # Delete the old output files.
5232 $run $rm $output $output_objdir/$outputname $output_objdir/lt-
$outputname
5234 $show "$link_command"
5235 $run eval "$link_command" ||
exit $?
5237 # Now create the wrapper script.
5238 $show "creating $output"
5240 # Quote the relink command for shipping.
5241 if test -n "$relink_command"; then
5242 # Preserve any variables that may affect compiler behavior
5243 for var
in $variables_saved_for_relink; do
5244 if eval test -z \"\
${$var+set}\"; then
5245 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5246 elif eval var_value
=\$
$var; test -z "$var_value"; then
5247 relink_command
="$var=; export $var; $relink_command"
5249 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5250 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
5253 relink_command
="(cd `pwd`; $relink_command)"
5254 relink_command
=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
5257 # Quote $echo for shipping.
5258 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
5260 [\\/]* |
[A-Za-z
]:[\\/]*) qecho
="$SHELL $progpath --fallback-echo";;
5261 *) qecho
="$SHELL `pwd`/$progpath --fallback-echo";;
5263 qecho
=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
5265 qecho
=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
5268 # Only actually do things if our run command is non-null.
5269 if test -z "$run"; then
5270 # win32 will think the script is a binary if it has
5271 # a .exe suffix, so we strip it off here.
5273 *.exe
) output
=`$echo $output|${SED} 's,.exe$,,'` ;;
5275 # test for cygwin because mv fails w/o .exe extensions
5279 outputname
=`$echo $outputname|${SED} 's,.exe$,,'` ;;
5283 *cygwin
* |
*mingw
* )
5284 output_name
=`basename $output`
5285 output_path
=`dirname $output`
5286 cwrappersource
="$output_path/$objdir/lt-$output_name.c"
5287 cwrapper
="$output_path/$output_name.exe"
5288 $rm $cwrappersource $cwrapper
5289 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
5291 cat > $cwrappersource <<EOF
5293 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
5294 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5296 The $output program cannot be directly executed until all the libtool
5297 libraries that it depends on are installed.
5299 This wrapper executable should never be moved out of the build directory.
5300 If it is, it will not operate correctly.
5302 Currently, it simply execs the wrapper *script* "/bin/sh $output",
5303 but could eventually absorb all of the scripts functionality and
5304 exec $objdir/$outputname directly.
5307 cat >> $cwrappersource<<"EOF"
5316 #include <sys/stat.h>
5318 #if defined(PATH_MAX)
5319 # define LT_PATHMAX PATH_MAX
5320 #elif defined(MAXPATHLEN)
5321 # define LT_PATHMAX MAXPATHLEN
5323 # define LT_PATHMAX 1024
5326 #ifndef DIR_SEPARATOR
5327 # define DIR_SEPARATOR '/'
5328 # define PATH_SEPARATOR ':'
5331 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
5333 # define HAVE_DOS_BASED_FILE_SYSTEM
5334 # ifndef DIR_SEPARATOR_2
5335 # define DIR_SEPARATOR_2 '\\'
5337 # ifndef PATH_SEPARATOR_2
5338 # define PATH_SEPARATOR_2 ';'
5342 #ifndef DIR_SEPARATOR_2
5343 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
5344 #else /* DIR_SEPARATOR_2 */
5345 # define IS_DIR_SEPARATOR(ch) \
5346 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
5347 #endif /* DIR_SEPARATOR_2 */
5349 #ifndef PATH_SEPARATOR_2
5350 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
5351 #else /* PATH_SEPARATOR_2 */
5352 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
5353 #endif /* PATH_SEPARATOR_2 */
5355 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
5356 #define XFREE(stale) do { \
5357 if (stale) { free ((void *) stale); stale = 0; } \
5360 /* -DDEBUG is fairly common in CFLAGS. */
5362 #if defined DEBUGWRAPPER
5363 # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
5365 # define DEBUG(format, ...)
5368 const char *program_name = NULL;
5370 void * xmalloc (size_t num);
5371 char * xstrdup (const char *string);
5372 const char * base_name (const char *name);
5373 char * find_executable(const char *wrapper);
5374 int check_executable(const char *path);
5375 char * strendzap(char *str, const char *pat);
5376 void lt_fatal (const char *message, ...);
5379 main (int argc, char *argv[])
5384 program_name = (char *) xstrdup (base_name (argv[0]));
5385 DEBUG("(main) argv[0] : %s\n",argv[0]);
5386 DEBUG("(main) program_name : %s\n",program_name);
5387 newargz = XMALLOC(char *, argc+2);
5390 cat >> $cwrappersource <<EOF
5391 newargz[0] = (char *) xstrdup("$SHELL");
5394 cat >> $cwrappersource <<"EOF"
5395 newargz
[1] = find_executable
(argv
[0]);
5396 if (newargz
[1] == NULL
)
5397 lt_fatal
("Couldn't find %s", argv
[0]);
5398 DEBUG
("(main) found exe at : %s\n",newargz
[1]);
5399 /* we know the
script has the same name
, without the .exe
*/
5400 /* so
make sure newargz
[1] doesn
't end in .exe */
5401 strendzap(newargz[1],".exe");
5402 for (i = 1; i < argc; i++)
5403 newargz[i+1] = xstrdup(argv[i]);
5404 newargz[argc+1] = NULL;
5406 for (i=0; i<argc+1; i++)
5408 DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
5416 cat >> $cwrappersource <<EOF
5417 execv("$SHELL",(char const **)newargz);
5421 cat >> $cwrappersource <<EOF
5422 execv("$SHELL",newargz);
5427 cat >> $cwrappersource <<"EOF"
5432 xmalloc (size_t num)
5434 void * p = (void *) malloc (num);
5436 lt_fatal ("Memory exhausted");
5442 xstrdup (const char *string)
5444 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5449 base_name (const char *name)
5453 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5454 /* Skip over the disk name in MSDOS pathnames. */
5455 if (isalpha ((unsigned char)name[0]) && name[1] == ':')
5459 for (base = name; *name; name++)
5460 if (IS_DIR_SEPARATOR (*name))
5466 check_executable(const char * path)
5470 DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
5471 if ((!path) || (!*path))
5474 if ((stat (path, &st) >= 0) &&
5476 /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
5477 #if defined (S_IXOTH)
5478 ((st.st_mode & S_IXOTH) == S_IXOTH) ||
5480 #if defined (S_IXGRP)
5481 ((st.st_mode & S_IXGRP) == S_IXGRP) ||
5483 ((st.st_mode & S_IXUSR) == S_IXUSR))
5490 /* Searches for the full path of the wrapper. Returns
5491 newly allocated full path name if found, NULL otherwise */
5493 find_executable (const char* wrapper)
5498 /* static buffer for getcwd */
5499 char tmp[LT_PATHMAX + 1];
5503 DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
5505 if ((wrapper == NULL) || (*wrapper == '\
0'))
5508 /* Absolute path? */
5509 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5510 if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
5512 concat_name = xstrdup (wrapper);
5513 if (check_executable(concat_name))
5520 if (IS_DIR_SEPARATOR (wrapper[0]))
5522 concat_name = xstrdup (wrapper);
5523 if (check_executable(concat_name))
5527 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5531 for (p = wrapper; *p; p++)
5539 /* no slashes; search PATH */
5540 const char* path = getenv ("PATH");
5543 for (p = path; *p; p = p_next)
5547 for (q = p; *q; q++)
5548 if (IS_PATH_SEPARATOR(*q))
5551 p_next = (*q == '\
0' ? q : q + 1);
5554 /* empty path: current directory */
5555 if (getcwd (tmp, LT_PATHMAX) == NULL)
5556 lt_fatal ("getcwd failed");
5557 tmp_len = strlen(tmp);
5558 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5559 memcpy (concat_name, tmp, tmp_len);
5560 concat_name[tmp_len] = '/';
5561 strcpy (concat_name + tmp_len + 1, wrapper);
5565 concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
5566 memcpy (concat_name, p, p_len);
5567 concat_name[p_len] = '/';
5568 strcpy (concat_name + p_len + 1, wrapper);
5570 if (check_executable(concat_name))
5575 /* not found in PATH; assume curdir */
5577 /* Relative path | not found in path: prepend cwd */
5578 if (getcwd (tmp, LT_PATHMAX) == NULL)
5579 lt_fatal ("getcwd failed");
5580 tmp_len = strlen(tmp);
5581 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5582 memcpy (concat_name, tmp, tmp_len);
5583 concat_name[tmp_len] = '/';
5584 strcpy (concat_name + tmp_len + 1, wrapper);
5586 if (check_executable(concat_name))
5593 strendzap(char *str, const char *pat)
5597 assert(str != NULL);
5598 assert(pat != NULL);
5601 patlen = strlen(pat);
5605 str += len - patlen;
5606 if (strcmp(str, pat) == 0)
5613 lt_error_core (int exit_status, const char * mode,
5614 const char * message, va_list ap)
5616 fprintf (stderr, "%s: %s: ", program_name, mode);
5617 vfprintf (stderr, message, ap);
5618 fprintf (stderr, ".\n");
5620 if (exit_status >= 0)
5625 lt_fatal (const char *message, ...)
5628 va_start (ap, message);
5629 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5633 # we should really use a build-platform specific compiler
5634 # here, but OTOH, the wrappers (shell script and this C one)
5635 # are only useful if you want to execute the "real" binary.
5636 # Since the "real" binary is built for $host, then this
5637 # wrapper might as well be built for $host, too.
5638 $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
5642 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5647 # $output - temporary wrapper script for $objdir/$outputname
5648 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5650 # The $output program cannot be directly executed until all the libtool
5651 # libraries that it depends on are installed.
5653 # This wrapper script should never be moved out of the build directory.
5654 # If it is, it will not operate correctly.
5656 # Sed substitution that helps us do robust quoting. It backslashifies
5657 # metacharacters that are still active within double-quoted strings.
5658 Xsed='${SED} -e 1s
/^X
//'
5659 sed_quote_subst='$sed_quote_subst'
5661 # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
5662 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
5665 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
5666 # is contrary to our usage. Disable this feature.
5667 alias -g '\
${1+\"\$@\"}'='\"\$@
\"'
5668 setopt NO_GLOB_SUBST
5670 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
5672 BIN_SH=xpg4; export BIN_SH # for Tru64
5673 DUALCASE=1; export DUALCASE # for MKS sh
5675 # The HP-UX ksh and POSIX shell print the target directory to stdout
5677 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5679 relink_command=\"$relink_command\"
5681 # This environment variable determines our operation mode.
5682 if test \"\$libtool_install_magic\" = \"$magic\"; then
5683 # install mode needs the following variable:
5684 notinst_deplibs='$notinst_deplibs'
5686 # When we are sourced in execute mode, \$file and \$echo are already set.
5687 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5690 # Make sure echo works.
5691 if test \"X\$1\" = X--no-reexec; then
5692 # Discard the --no-reexec flag, and continue.
5694 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X
\t'; then
5695 # Yippee, \$echo works!
5698 # Restart under the correct shell, and then maybe \$echo will work.
5699 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5705 # Find the directory that this script lives in.
5706 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's
%/[^
/]*$
%%'\`
5707 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5709 # Follow symbolic links until we get to the real thisdir.
5710 file=\`ls -ld \"\$file\" | ${SED} -n 's
/.
*-> //p
'\`
5711 while test -n \"\$file\"; do
5712 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's
%/[^
/]*\$
%%'\`
5714 # If there was a directory component, then change thisdir.
5715 if test \"x\$destdir\" != \"x\$file\"; then
5716 case \"\$destdir\" in
5717 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5718 *) thisdir=\"\$thisdir/\$destdir\" ;;
5722 file=\`\$echo \"X\$file\" | \$Xsed -e 's
%^.
*/%%'\`
5723 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's
/.
*-> //p
'\`
5726 # Try to get the absolute directory name.
5727 absdir=\`cd \"\$thisdir\" && pwd\`
5728 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5731 if test "$fast_install" = yes; then
5733 program=lt-'$outputname'$exeext
5734 progdir=\"\$thisdir/$objdir\"
5736 if test ! -f \"\$progdir/\$program\" || \\
5737 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5738 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5740 file=\"\$\$-\$program\"
5742 if test ! -d \"\$progdir\"; then
5743 $mkdir \"\$progdir\"
5745 $rm \"\$progdir/\$file\"
5750 # relink executable if necessary
5751 if test -n \"\$relink_command\"; then
5752 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5754 $echo \"\$relink_command_output\" >&2
5755 $rm \"\$progdir/\$file\"
5760 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5761 { $rm \"\$progdir/\$program\";
5762 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5763 $rm \"\$progdir/\$file\"
5767 program='$outputname'
5768 progdir=\"\$thisdir/$objdir\"
5774 if test -f \"\$progdir/\$program\"; then"
5776 # Export our shlibpath_var if we have one.
5777 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5779 # Add our own library path to $shlibpath_var
5780 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5782 # Some systems cannot cope with colon-terminated $shlibpath_var
5783 # The second colon is a workaround for a bug in BeOS R4 sed
5784 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's
/::*\$
//'\`
5786 export $shlibpath_var
5790 # fixup the dll searchpath if we need to.
5791 if test -n "$dllsearchpath"; then
5793 # Add the dll search path components to the executable PATH
5794 PATH=$dllsearchpath:\$PATH
5799 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5800 # Run the actual program with our arguments.
5803 # Backslashes separate directories on plain windows
5804 *-*-mingw | *-*-os2*)
5806 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5812 exec \"\$progdir/\$program\" \${1+\"\$@\"}
5817 \$echo \"\$0: cannot exec \$program \$*\"
5821 # The program doesn't exist.
5822 \
$echo \"\
$0: error
: \\\
`\$progdir/\$program' does not exist\" 1>&2
5823 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5824 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5835 # See if we need to build an old-fashioned archive.
5836 for oldlib in $oldlibs; do
5838 if test "$build_libtool_libs" = convenience; then
5839 oldobjs="$libobjs_save"
5840 addlibs="$convenience"
5841 build_libtool_libs=no
5843 if test "$build_libtool_libs" = module; then
5844 oldobjs="$libobjs_save"
5845 build_libtool_libs=no
5847 oldobjs="$old_deplibs $non_pic_objects"
5849 addlibs="$old_convenience"
5852 if test -n "$addlibs"; then
5853 gentop="$output_objdir/${outputname}x"
5854 generated="$generated $gentop"
5856 func_extract_archives $gentop $addlibs
5857 oldobjs="$oldobjs $func_extract_archives_result"
5860 # Do each command in the archive commands.
5861 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5862 cmds=$old_archive_from_new_cmds
5864 # POSIX demands no paths to be encoded in archives. We have
5865 # to avoid creating archives with duplicate basenames if we
5866 # might have to extract them afterwards, e.g., when creating a
5867 # static archive out of a convenience library, or when linking
5868 # the entirety of a libtool archive into another (currently
5869 # not supported by libtool).
5870 if (for obj in $oldobjs
5872 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5873 done | sort | sort -uc >/dev/null 2>&1); then
5876 $echo "copying selected object files to avoid basename conflicts..."
5878 if test -z "$gentop"; then
5879 gentop="$output_objdir/${outputname}x"
5880 generated="$generated $gentop"
5882 $show "${rm}r $gentop"
5883 $run ${rm}r "$gentop"
5884 $show "$mkdir $gentop"
5885 $run $mkdir "$gentop"
5887 if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
5892 save_oldobjs=$oldobjs
5895 for obj in $save_oldobjs
5897 objbase=`$echo "X$obj" |
$Xsed -e 's%^.*/%%'`
5898 case " $oldobjs " in
5899 " ") oldobjs=$obj ;;
5902 # Make sure we don't pick an alternate name that also
5904 newobj=lt$counter-$objbase
5905 counter=`expr $counter + 1`
5906 case " $oldobjs " in
5907 *[\ /]"$newobj "*) ;;
5908 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
5911 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5912 $run ln "$obj" "$gentop/$newobj" ||
5913 $run cp "$obj" "$gentop/$newobj"
5914 oldobjs="$oldobjs $gentop/$newobj"
5916 *) oldobjs="$oldobjs $obj" ;;
5921 eval cmds=\"$old_archive_cmds\"
5923 if len=`expr "X$cmds" : ".*"` &&
5924 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5925 cmds=$old_archive_cmds
5927 # the command line is too long to link in one step, link in parts
5928 $echo "using piecewise archive linking..."
5933 save_oldobjs=$oldobjs
5935 # Is there a better way of finding the last object in the list?
5936 for obj in $save_oldobjs
5940 for obj in $save_oldobjs
5942 oldobjs="$objlist $obj"
5943 objlist="$objlist $obj"
5944 eval test_cmds=\"$old_archive_cmds\"
5945 if len=`expr "X$test_cmds" : ".*" 2>/dev
/null
` &&
5946 test "$len" -le "$max_cmd_len"; then
5949 # the above command should be used before it gets too long
5951 if test "$obj" = "$last_oldobj" ; then
5954 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5955 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5961 if test "X$oldobjs" = "X" ; then
5962 eval cmds=\"\$concat_cmds\"
5964 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5968 save_ifs="$IFS"; IFS='~'
5969 for cmd in $cmds; do
5973 $run eval "$cmd" || exit $?
5978 if test -n "$generated"; then
5979 $show "${rm}r$generated"
5980 $run ${rm}r$generated
5983 # Now create the libtool archive.
5987 test "$build_old_libs" = yes && old_library="$libname.$libext"
5988 $show "creating $output"
5990 # Preserve any variables that may affect compiler behavior
5991 for var in $variables_saved_for_relink; do
5992 if eval test -z \"\${$var+set}\"; then
5993 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5994 elif eval var_value=\$$var; test -z "$var_value"; then
5995 relink_command="$var=; export $var; $relink_command"
5997 var_value=`$echo "X$var_value" |
$Xsed -e "$sed_quote_subst"`
5998 relink_command="$var=\"$var_value\"; export $var; $relink_command"
6001 # Quote the link command for shipping.
6002 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
6003 relink_command=`$echo "X$relink_command" |
$SP2NL |
$Xsed -e "$sed_quote_subst" |
$NL2SP`
6004 if test "$hardcode_automatic" = yes ; then
6009 # Only create the output if not a dry run.
6010 if test -z "$run"; then
6011 for installed in no yes; do
6012 if test "$installed" = yes; then
6013 if test -z "$install_libdir"; then
6016 output="$output_objdir/$outputname"i
6017 # Replace all uninstalled libtool libraries with the installed ones
6019 for deplib in $dependency_libs; do
6022 name=`$echo "X$deplib" |
$Xsed -e 's%^.*/%%'`
6023 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
6024 if test -z "$libdir"; then
6025 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
6028 newdependency_libs="$newdependency_libs $libdir/$name"
6030 *) newdependency_libs="$newdependency_libs $deplib" ;;
6033 dependency_libs="$newdependency_libs"
6035 for lib in $dlfiles; do
6036 name=`$echo "X$lib" | $Xsed -e 's
%^.
*/%%'`
6037 eval libdir=`${SED} -n -e 's
/^libdir
=\
(.
*\
)$
/\
1/p
' $lib`
6038 if test -z "$libdir"; then
6039 $echo "$modename: \`$lib' is not a valid libtool archive
" 1>&2
6042 newdlfiles="$newdlfiles $libdir/$name"
6044 dlfiles="$newdlfiles"
6046 for lib in $dlprefiles; do
6047 name=`$echo "X
$lib" | $Xsed -e 's%^.*/%%'`
6048 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
6049 if test -z "$libdir"; then
6050 $echo "$modename: \
`$lib' is not a valid libtool archive" 1>&2
6053 newdlprefiles="$newdlprefiles $libdir/$name"
6055 dlprefiles="$newdlprefiles"
6058 for lib in $dlfiles; do
6060 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
6061 *) abs=`pwd`"/$lib" ;;
6063 newdlfiles="$newdlfiles $abs"
6065 dlfiles="$newdlfiles"
6067 for lib in $dlprefiles; do
6069 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
6070 *) abs=`pwd`"/$lib" ;;
6072 newdlprefiles="$newdlprefiles $abs"
6074 dlprefiles="$newdlprefiles"
6077 # place dlname in correct position for cygwin
6079 case $host,$output,$installed,$module,$dlname in
6080 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
6083 # $outputname - a libtool library file
6084 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
6086 # Please DO NOT delete this file!
6087 # It is necessary for linking the library.
6089 # The name that we can dlopen(3).
6092 # Names of this library.
6093 library_names='$library_names'
6095 # The name of the static archive.
6096 old_library='$old_library'
6098 # Libraries that this one depends upon.
6099 dependency_libs='$dependency_libs'
6101 # Version information for $libname.
6106 # Is this an already installed library?
6107 installed=$installed
6109 # Should we warn about portability when linking against -modules?
6110 shouldnotlink=$module
6112 # Files to dlopen/dlpreopen
6114 dlpreopen='$dlprefiles'
6116 # Directory that this library needs to be installed in:
6117 libdir='$install_libdir'"
6118 if test "$installed" = no && test "$need_relink" = yes; then
6120 relink_command=\"$relink_command\""
6125 # Do a symbolic link so that the libtool archive can be found in
6126 # LD_LIBRARY_PATH before the program is installed.
6127 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
6128 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
6134 # libtool install mode
6136 modename="$modename: install"
6138 # There may be an optional sh(1) argument at the beginning of
6139 # install_prog (especially on Windows NT).
6140 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
6141 # Allow the use of GNU shtool's install command.
6142 $echo "X$nonopt" | grep shtool > /dev/null; then
6143 # Aesthetically quote it.
6144 arg=`$echo "X$nonopt" |
$Xsed -e "$sed_quote_subst"`
6146 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6150 install_prog="$arg "
6158 # The real first argument should be the name of the installation program.
6159 # Aesthetically quote it.
6160 arg=`$echo "X$arg" |
$Xsed -e "$sed_quote_subst"`
6162 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6166 install_prog="$install_prog$arg"
6168 # We need to accept at least all the BSD install flags.
6178 if test -n "$dest"; then
6179 files="$files $dest"
6187 case " $install_prog " in
6192 -g | -m | -o) prev=$arg ;;
6200 # If the previous option needed an argument, then skip it.
6201 if test -n "$prev"; then
6210 # Aesthetically quote the argument.
6211 arg=`$echo "X$arg" |
$Xsed -e "$sed_quote_subst"`
6213 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6217 install_prog="$install_prog $arg"
6220 if test -z "$install_prog"; then
6221 $echo "$modename: you must specify an install program" 1>&2
6226 if test -n "$prev"; then
6227 $echo "$modename: the \`$prev' option requires an argument" 1>&2
6232 if test -z "$files"; then
6233 if test -z "$dest"; then
6234 $echo "$modename: no file or destination specified" 1>&2
6236 $echo "$modename: you must specify a destination" 1>&2
6242 # Strip any trailing slash from the destination.
6243 dest=`$echo "X$dest" | $Xsed -e 's
%/$
%%'`
6245 # Check to see that the destination is a directory.
6246 test -d "$dest" && isdir=yes
6247 if test "$isdir" = yes; then
6251 destdir=`$echo "X$dest" | $Xsed -e 's
%/[^
/]*$
%%'`
6252 test "X$destdir" = "X$dest" && destdir=.
6253 destname=`$echo "X$dest" | $Xsed -e 's
%^.
*/%%'`
6255 # Not a directory, so check to see that there is only one file specified.
6257 if test "$#" -gt 2; then
6258 $echo "$modename: \`$dest' is not a directory
" 1>&2
6264 [\\/]* | [A-Za-z]:[\\/]*) ;;
6266 for file in $files; do
6270 $echo "$modename: \
`$destdir' must be an absolute directory name" 1>&2
6279 # This variable tells wrapper scripts just to set variables rather
6280 # than running their programs.
6281 libtool_install_magic="$magic"
6286 for file in $files; do
6288 # Do each installation.
6291 # Do the static libraries later.
6292 staticlibs="$staticlibs $file"
6296 # Check to see that this really is a libtool archive.
6297 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6299 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
6307 # If there is no directory component, then add one.
6309 */* | *\\*) . $file ;;
6313 # Add the libdir to current_libdirs if it is the destination.
6314 if test "X$destdir" = "X$libdir"; then
6315 case "$current_libdirs " in
6317 *) current_libdirs="$current_libdirs $libdir" ;;
6320 # Note the libdir as a future libdir.
6321 case "$future_libdirs " in
6323 *) future_libdirs="$future_libdirs $libdir" ;;
6327 dir=`$echo "X$file" | $Xsed -e 's
%/[^
/]*$
%%'`/
6328 test "X$dir" = "X$file/" && dir=
6331 if test -n "$relink_command"; then
6332 # Determine the prefix the user has applied to our future dir.
6333 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
6335 # Don't allow the user to place us outside of our expected
6336 # location b/c this prevents finding dependent libraries that
6337 # are installed to the same prefix.
6338 # At present, this check doesn't affect windows .dll's that
6339 # are installed into $libdir/../bin (currently, that works fine)
6340 # but it's something to keep an eye on.
6341 if test "$inst_prefix_dir" = "$destdir"; then
6342 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
6346 if test -n "$inst_prefix_dir"; then
6347 # Stick the inst_prefix_dir data into the link command.
6348 relink_command
=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
6350 relink_command
=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
6353 $echo "$modename: warning: relinking \`$file'" 1>&2
6354 $show "$relink_command"
6355 if $run eval "$relink_command"; then :
6357 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6362 # See the names of the shared library.
6363 set dummy
$library_names
6364 if test -n "$2"; then
6370 test -n "$relink_command" && srcname
="$realname"T
6372 # Install the shared library and build the symlinks.
6373 $show "$install_prog $dir/$srcname $destdir/$realname"
6374 $run eval "$install_prog $dir/$srcname $destdir/$realname" ||
exit $?
6375 if test -n "$stripme" && test -n "$striplib"; then
6376 $show "$striplib $destdir/$realname"
6377 $run eval "$striplib $destdir/$realname" ||
exit $?
6380 if test "$#" -gt 0; then
6381 # Delete the old symlinks, and create new ones.
6382 # Try `ln -sf' first, because the `ln' binary might depend on
6383 # the symlink we replace! Solaris /bin/ln does not understand -f,
6384 # so we also need to try rm && ln -s.
6387 if test "$linkname" != "$realname"; then
6388 $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6389 $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6394 # Do each command in the postinstall commands.
6395 lib
="$destdir/$realname"
6396 cmds
=$postinstall_cmds
6397 save_ifs
="$IFS"; IFS
='~'
6398 for cmd
in $cmds; do
6402 $run eval "$cmd" ||
{
6405 # Restore the uninstalled library and exit
6406 if test "$mode" = relink
; then
6407 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
6416 # Install the pseudo-library for information purposes.
6417 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6418 instname
="$dir/$name"i
6419 $show "$install_prog $instname $destdir/$name"
6420 $run eval "$install_prog $instname $destdir/$name" ||
exit $?
6422 # Maybe install the static library, too.
6423 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
6427 # Install (i.e. copy) a libtool object.
6429 # Figure out destination file name, if it wasn't already specified.
6430 if test -n "$destname"; then
6431 destfile
="$destdir/$destname"
6433 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6434 destfile
="$destdir/$destfile"
6437 # Deduce the name of the destination old-style object file.
6440 staticdest
=`$echo "X$destfile" | $Xsed -e "$lo2o"`
6443 staticdest
="$destfile"
6447 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
6453 # Install the libtool object if requested.
6454 if test -n "$destfile"; then
6455 $show "$install_prog $file $destfile"
6456 $run eval "$install_prog $file $destfile" ||
exit $?
6459 # Install the old object if enabled.
6460 if test "$build_old_libs" = yes; then
6461 # Deduce the name of the old-style object file.
6462 staticobj
=`$echo "X$file" | $Xsed -e "$lo2o"`
6464 $show "$install_prog $staticobj $staticdest"
6465 $run eval "$install_prog \$staticobj \$staticdest" ||
exit $?
6471 # Figure out destination file name, if it wasn't already specified.
6472 if test -n "$destname"; then
6473 destfile
="$destdir/$destname"
6475 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6476 destfile
="$destdir/$destfile"
6479 # If the file is missing, and there is a .exe on the end, strip it
6480 # because it is most likely a libtool script we actually want to
6485 if test ! -f "$file"; then
6486 file=`$echo $file|${SED} 's,.exe$,,'`
6492 # Do a test to see if this is really a libtool program.
6495 wrapper
=`$echo $file | ${SED} -e 's,.exe$,,'`
6501 if (${SED} -e '4q' $wrapper |
grep "^# Generated by .*$PACKAGE")>/dev
/null
2>&1; then
6505 # Note that it is not necessary on cygwin/mingw to append a dot to
6506 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6507 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6508 # `FILE.' does not work on cygwin managed mounts.
6510 # If there is no directory component, then add one.
6512 */* |
*\\*) .
${wrapper} ;;
6513 *) . .
/${wrapper} ;;
6516 # Check the variables that should have been set.
6517 if test -z "$notinst_deplibs"; then
6518 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
6523 for lib
in $notinst_deplibs; do
6524 # Check to see that each library is installed.
6526 if test -f "$lib"; then
6527 # If there is no directory component, then add one.
6529 */* |
*\\*) .
$lib ;;
6533 libfile
="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
6534 if test -n "$libdir" && test ! -f "$libfile"; then
6535 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
6541 # Note that it is not necessary on cygwin/mingw to append a dot to
6542 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6543 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6544 # `FILE.' does not work on cygwin managed mounts.
6546 # If there is no directory component, then add one.
6548 */* |
*\\*) .
${wrapper} ;;
6549 *) . .
/${wrapper} ;;
6553 if test "$fast_install" = no
&& test -n "$relink_command"; then
6554 if test "$finalize" = yes && test -z "$run"; then
6555 tmpdir
=`func_mktempdir`
6556 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6557 outputname
="$tmpdir/$file"
6558 # Replace the output file specification.
6559 relink_command
=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
6561 $show "$relink_command"
6562 if $run eval "$relink_command"; then :
6564 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6570 $echo "$modename: warning: cannot relink \`$file'" 1>&2
6573 # Install the binary that we compiled earlier.
6574 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
6578 # remove .exe since cygwin /usr/bin/install will append another
6580 case $install_prog,$host in
6581 */usr
/bin
/install*,*cygwin
*)
6582 case $file:$destfile in
6587 destfile
=$destfile.exe
6590 destfile
=`$echo $destfile | ${SED} -e 's,.exe$,,'`
6595 $show "$install_prog$stripme $file $destfile"
6596 $run eval "$install_prog\$stripme \$file \$destfile" ||
exit $?
6597 test -n "$outputname" && ${rm}r
"$tmpdir"
6602 for file in $staticlibs; do
6603 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6605 # Set up the ranlib parameters.
6606 oldlib
="$destdir/$name"
6608 $show "$install_prog $file $oldlib"
6609 $run eval "$install_prog \$file \$oldlib" ||
exit $?
6611 if test -n "$stripme" && test -n "$old_striplib"; then
6612 $show "$old_striplib $oldlib"
6613 $run eval "$old_striplib $oldlib" ||
exit $?
6616 # Do each command in the postinstall commands.
6617 cmds
=$old_postinstall_cmds
6618 save_ifs
="$IFS"; IFS
='~'
6619 for cmd
in $cmds; do
6623 $run eval "$cmd" ||
exit $?
6628 if test -n "$future_libdirs"; then
6629 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
6632 if test -n "$current_libdirs"; then
6633 # Maybe just do a dry run.
6634 test -n "$run" && current_libdirs
=" -n$current_libdirs"
6635 exec_cmd
='$SHELL $progpath $preserve_args --finish$current_libdirs'
6641 # libtool finish mode
6643 modename
="$modename: finish"
6647 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
6650 libdirs
="$libdirs $dir"
6653 for libdir
in $libdirs; do
6654 if test -n "$finish_cmds"; then
6655 # Do each command in the finish commands.
6657 save_ifs
="$IFS"; IFS
='~'
6658 for cmd
in $cmds; do
6662 $run eval "$cmd" || admincmds
="$admincmds
6667 if test -n "$finish_eval"; then
6668 # Do the single finish_eval.
6669 eval cmds
=\"$finish_eval\"
6670 $run eval "$cmds" || admincmds
="$admincmds
6676 # Exit here if they wanted silent mode.
6677 test "$show" = : && exit $EXIT_SUCCESS
6679 $echo "X----------------------------------------------------------------------" |
$Xsed
6680 $echo "Libraries have been installed in:"
6681 for libdir
in $libdirs; do
6685 $echo "If you ever happen to want to link against installed libraries"
6686 $echo "in a given directory, LIBDIR, you must either use libtool, and"
6687 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6688 $echo "flag during linking and do at least one of the following:"
6689 if test -n "$shlibpath_var"; then
6690 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6691 $echo " during execution"
6693 if test -n "$runpath_var"; then
6694 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
6695 $echo " during linking"
6697 if test -n "$hardcode_libdir_flag_spec"; then
6699 eval flag
=\"$hardcode_libdir_flag_spec\"
6701 $echo " - use the \`$flag' linker flag"
6703 if test -n "$admincmds"; then
6704 $echo " - have your system administrator run these commands:$admincmds"
6706 if test -f /etc
/ld.so.conf
; then
6707 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6710 $echo "See any operating system documentation about shared libraries for"
6711 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6712 $echo "X----------------------------------------------------------------------" |
$Xsed
6716 # libtool execute mode
6718 modename
="$modename: execute"
6720 # The first argument is the command name.
6722 if test -z "$cmd"; then
6723 $echo "$modename: you must specify a COMMAND" 1>&2
6728 # Handle -dlopen flags immediately.
6729 for file in $execute_dlfiles; do
6730 if test ! -f "$file"; then
6731 $echo "$modename: \`$file' is not a file" 1>&2
6739 # Check to see that this really is a libtool archive.
6740 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
6742 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6747 # Read the libtool library.
6751 # If there is no directory component, then add one.
6753 */* |
*\\*) .
$file ;;
6757 # Skip this library if it cannot be dlopened.
6758 if test -z "$dlname"; then
6759 # Warn if it was a shared library.
6760 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6764 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6765 test "X$dir" = "X$file" && dir
=.
6767 if test -f "$dir/$objdir/$dlname"; then
6770 if test ! -f "$dir/$dlname"; then
6771 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6778 # Just add the directory containing the .lo file.
6779 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6780 test "X$dir" = "X$file" && dir
=.
6784 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6789 # Get the absolute pathname.
6790 absdir
=`cd "$dir" && pwd`
6791 test -n "$absdir" && dir
="$absdir"
6793 # Now add the directory to shlibpath_var.
6794 if eval "test -z \"\$$shlibpath_var\""; then
6795 eval "$shlibpath_var=\"\$dir\""
6797 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6801 # This variable tells wrapper scripts just to set shlibpath_var
6802 # rather than running their programs.
6803 libtool_execute_magic
="$magic"
6805 # Check if any of the arguments is a wrapper script.
6812 # Do a test to see if this is really a libtool program.
6813 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6814 # If there is no directory component, then add one.
6816 */* |
*\\*) .
$file ;;
6820 # Transform arg to wrapped name.
6821 file="$progdir/$program"
6825 # Quote arguments (to preserve shell metacharacters).
6826 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6827 args
="$args \"$file\""
6830 if test -z "$run"; then
6831 if test -n "$shlibpath_var"; then
6832 # Export the shlibpath_var.
6833 eval "export $shlibpath_var"
6836 # Restore saved environment variables
6837 for lt_var
in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
6839 eval "if test \"\${save_$lt_var+set}\" = set; then
6840 $lt_var=\$save_$lt_var; export $lt_var
6844 # Now prepare to actually exec the command.
6845 exec_cmd
="\$cmd$args"
6847 # Display what would be done.
6848 if test -n "$shlibpath_var"; then
6849 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6850 $echo "export $shlibpath_var"
6857 # libtool clean and uninstall mode
6859 modename
="$modename: $mode"
6865 # This variable tells wrapper scripts just to set variables rather
6866 # than running their programs.
6867 libtool_install_magic
="$magic"
6872 -f) rm="$rm $arg"; rmforce
=yes ;;
6873 -*) rm="$rm $arg" ;;
6874 *) files
="$files $arg" ;;
6878 if test -z "$rm"; then
6879 $echo "$modename: you must specify an RM program" 1>&2
6886 origobjdir
="$objdir"
6887 for file in $files; do
6888 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6889 if test "X$dir" = "X$file"; then
6891 objdir
="$origobjdir"
6893 objdir
="$dir/$origobjdir"
6895 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6896 test "$mode" = uninstall
&& objdir
="$dir"
6898 # Remember objdir for removal later, being careful to avoid duplicates
6899 if test "$mode" = clean
; then
6902 *) rmdirs
="$rmdirs $objdir" ;;
6906 # Don't error if the file doesn't exist and rm -f was used.
6907 if (test -L "$file") >/dev
/null
2>&1 \
6908 ||
(test -h "$file") >/dev
/null
2>&1 \
6909 ||
test -f "$file"; then
6911 elif test -d "$file"; then
6914 elif test "$rmforce" = yes; then
6922 # Possibly a libtool archive, so verify it.
6923 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6926 # Delete the libtool libraries and symlinks.
6927 for n
in $library_names; do
6928 rmfiles
="$rmfiles $objdir/$n"
6930 test -n "$old_library" && rmfiles
="$rmfiles $objdir/$old_library"
6934 case " $library_names " in
6935 # " " in the beginning catches empty $dlname
6937 *) rmfiles
="$rmfiles $objdir/$dlname" ;;
6939 test -n "$libdir" && rmfiles
="$rmfiles $objdir/$name $objdir/${name}i"
6942 if test -n "$library_names"; then
6943 # Do each command in the postuninstall commands.
6944 cmds
=$postuninstall_cmds
6945 save_ifs
="$IFS"; IFS
='~'
6946 for cmd
in $cmds; do
6951 if test "$?" -ne 0 && test "$rmforce" != yes; then
6958 if test -n "$old_library"; then
6959 # Do each command in the old_postuninstall commands.
6960 cmds
=$old_postuninstall_cmds
6961 save_ifs
="$IFS"; IFS
='~'
6962 for cmd
in $cmds; do
6967 if test "$?" -ne 0 && test "$rmforce" != yes; then
6973 # FIXME: should reinstall the best remaining shared library.
6980 # Possibly a libtool object, so verify it.
6981 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6986 # Add PIC object to the list of files to remove.
6987 if test -n "$pic_object" \
6988 && test "$pic_object" != none
; then
6989 rmfiles
="$rmfiles $dir/$pic_object"
6992 # Add non-PIC object to the list of files to remove.
6993 if test -n "$non_pic_object" \
6994 && test "$non_pic_object" != none
; then
6995 rmfiles
="$rmfiles $dir/$non_pic_object"
7001 if test "$mode" = clean
; then
7005 file=`$echo $file|${SED} 's,.exe$,,'`
7006 noexename
=`$echo $name|${SED} 's,.exe$,,'`
7007 # $file with .exe has already been added to rmfiles,
7008 # add $file without .exe
7009 rmfiles
="$rmfiles $file"
7012 # Do a test to see if this is a libtool program.
7013 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
7017 # note $name still contains .exe if it was in $file originally
7018 # as does the version of $file that was added into $rmfiles
7019 rmfiles
="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
7020 if test "$fast_install" = yes && test -n "$relink_command"; then
7021 rmfiles
="$rmfiles $objdir/lt-$name"
7023 if test "X$noexename" != "X$name" ; then
7024 rmfiles
="$rmfiles $objdir/lt-${noexename}.c"
7030 $show "$rm $rmfiles"
7031 $run $rm $rmfiles || exit_status
=1
7033 objdir
="$origobjdir"
7035 # Try to remove the ${objdir}s in the directories where we deleted files
7036 for dir
in $rmdirs; do
7037 if test -d "$dir"; then
7039 $run rmdir $dir >/dev
/null
2>&1
7047 $echo "$modename: you must specify a MODE" 1>&2
7048 $echo "$generic_help" 1>&2
7053 if test -z "$exec_cmd"; then
7054 $echo "$modename: invalid operation mode \`$mode'" 1>&2
7055 $echo "$generic_help" 1>&2
7058 fi # test -z "$show_help"
7060 if test -n "$exec_cmd"; then
7065 # We need to display help for each of the modes.
7068 "Usage: $modename [OPTION]... [MODE-ARG]...
7070 Provide generalized library-building support services.
7072 --config show all configuration variables
7073 --debug enable verbose shell tracing
7074 -n, --dry-run display commands without modifying any files
7075 --features display basic configuration information and exit
7076 --finish same as \`--mode=finish'
7077 --help display this help message and exit
7078 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
7079 --quiet same as \`--silent'
7080 --silent don't print informational messages
7081 --tag=TAG use configuration variables from tag TAG
7082 --version print version information
7084 MODE must be one of the following:
7086 clean remove files from the build directory
7087 compile compile a source file into a libtool object
7088 execute automatically set library path, then run a program
7089 finish complete the installation of libtool libraries
7090 install install libraries or executables
7091 link create a library or an executable
7092 uninstall remove libraries from an installed directory
7094 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
7095 a more detailed description of MODE.
7097 Report bugs to <bug-libtool@gnu.org>."
7103 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
7105 Remove files from the build directory.
7107 RM is the name of the program to use to delete files associated with each FILE
7108 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
7111 If FILE is a libtool library, object or program, all the files associated
7112 with it are deleted. Otherwise, only FILE itself is deleted using RM."
7117 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
7119 Compile a source file into a libtool library object.
7121 This mode accepts the following additional options:
7123 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
7124 -prefer-pic try to building PIC objects only
7125 -prefer-non-pic try to building non-PIC objects only
7126 -static always build a \`.o' file suitable for static linking
7128 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
7129 from the given SOURCEFILE.
7131 The output file name is determined by removing the directory component from
7132 SOURCEFILE, then substituting the C source code suffix \`.c' with the
7133 library object suffix, \`.lo'."
7138 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
7140 Automatically set library path, then run a program.
7142 This mode accepts the following additional options:
7144 -dlopen FILE add the directory containing FILE to the library path
7146 This mode sets the library path environment variable according to \`-dlopen'
7149 If any of the ARGS are libtool executable wrappers, then they are translated
7150 into their corresponding uninstalled binary, and any of their required library
7151 directories are added to the library path.
7153 Then, COMMAND is executed, with ARGS as arguments."
7158 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
7160 Complete the installation of libtool libraries.
7162 Each LIBDIR is a directory that contains libtool libraries.
7164 The commands that this mode executes may require superuser privileges. Use
7165 the \`--dry-run' option if you just want to see what would be executed."
7170 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
7172 Install executables or libraries.
7174 INSTALL-COMMAND is the installation command. The first component should be
7175 either the \`install' or \`cp' program.
7177 The rest of the components are interpreted as arguments to that command (only
7178 BSD-compatible install options are recognized)."
7183 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
7185 Link object files or libraries together to form another library, or to
7186 create an executable program.
7188 LINK-COMMAND is a command using the C compiler that you would use to create
7189 a program from several object files.
7191 The following components of LINK-COMMAND are treated specially:
7193 -all-static do not do any dynamic linking at all
7194 -avoid-version do not add a version suffix if possible
7195 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
7196 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
7197 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
7198 -export-symbols SYMFILE
7199 try to export only the symbols listed in SYMFILE
7200 -export-symbols-regex REGEX
7201 try to export only the symbols matching REGEX
7202 -LLIBDIR search LIBDIR for required installed libraries
7203 -lNAME OUTPUT-FILE requires the installed library libNAME
7204 -module build a library that can dlopened
7205 -no-fast-install disable the fast-install mode
7206 -no-install link a not-installable executable
7207 -no-undefined declare that a library does not refer to external symbols
7208 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
7209 -objectlist FILE Use a list of object files found in FILE to specify objects
7210 -precious-files-regex REGEX
7211 don't remove output files matching REGEX
7212 -release RELEASE specify package release information
7213 -rpath LIBDIR the created library will eventually be installed in LIBDIR
7214 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
7215 -static do not do any dynamic linking of uninstalled libtool libraries
7216 -static-libtool-libs
7217 do not do any dynamic linking of libtool libraries
7218 -version-info CURRENT[:REVISION[:AGE]]
7219 specify library version info [each variable defaults to 0]
7221 All other options (arguments beginning with \`-') are ignored.
7223 Every other argument is treated as a filename. Files ending in \`.la' are
7224 treated as uninstalled libtool libraries, other files are standard or library
7227 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
7228 only library objects (\`.lo' files) may be specified, and \`-rpath' is
7229 required, except when creating a convenience library.
7231 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
7232 using \`ar' and \`ranlib', or on Windows using \`lib'.
7234 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
7235 is created, otherwise an executable program is created."
7240 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
7242 Remove libraries from an installation directory.
7244 RM is the name of the program to use to delete files associated with each FILE
7245 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
7248 If FILE is a libtool library, all the files associated with it are deleted.
7249 Otherwise, only FILE itself is deleted using RM."
7253 $echo "$modename: invalid operation mode \`$mode'" 1>&2
7260 $echo "Try \`$modename --help' for more information about other modes."
7264 # The TAGs below are defined such that we never get into a situation
7265 # in which we disable both kinds of libraries. Given conflicting
7266 # choices, we go for a static library, that is the most portable,
7267 # since we can't tell whether shared libraries were disabled because
7268 # the user asked for that or because the platform doesn't support
7269 # them. This is particularly important on AIX, because we don't
7270 # support having both static and shared libraries enabled at the same
7271 # time on that platform, so we default to a shared-only configuration.
7272 # If a disable-shared tag is given, we'll fallback to a static-only
7273 # configuration. But we'll never go from static-only to shared-only.
7275 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
7277 # ### END LIBTOOL TAG CONFIG: disable-shared
7279 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
7281 # ### END LIBTOOL TAG CONFIG: disable-static
7287 # ### BEGIN LIBTOOL TAG CONFIG: CXX
7289 # Libtool was configured on host fireball:
7291 # Shell to use when invoking shell scripts.
7294 # Whether or not to build shared libraries.
7295 build_libtool_libs
=yes
7297 # Whether or not to build static libraries.
7300 # Whether or not to add -lc for building shared libraries.
7301 build_libtool_need_lc
=no
7303 # Whether or not to disallow shared libs when runtime libs are static
7304 allow_libtool_libs_with_static_runtimes
=no
7306 # Whether or not to optimize for fast installation.
7311 host=i686-suse-linux-gnu
7316 build
=i686-suse-linux-gnu
7319 # An echo program that does not interpret backslashes.
7329 # LTCC compiler flags.
7332 # A language-specific compiler.
7335 # Is the compiler the GNU C compiler?
7339 EGREP
="/usr/bin/grep -E"
7341 # The linker used to build libraries.
7342 LD
="/usr/i586-suse-linux/bin/ld"
7344 # Whether we need hard or soft links.
7347 # A BSD-compatible nm program.
7350 # A symbol stripping program
7353 # Used to examine libraries when file_magic_cmd begins "file"
7356 # Used on cygwin: DLL creation program.
7359 # Used on cygwin: object dumper.
7362 # Used on cygwin: assembler.
7365 # The name of the directory that contains temporary libtool files.
7368 # How to create reloadable object files.
7370 reload_cmds
="\$LD\$reload_flag -o \$output\$reload_objs"
7372 # How to pass a linker flag through the compiler.
7375 # Object file suffix (normally "o").
7378 # Old archive suffix (normally "a").
7381 # Shared library suffix (normally ".so").
7384 # Executable file suffix (normally "").
7387 # Additional compiler flags for building library objects.
7388 pic_flag
=" -fPIC -DPIC"
7391 # What is the maximum length of a command?
7394 # Does compiler simultaneously support -c and -o options?
7397 # Must we lock files when doing compilation?
7400 # Do we need the lib prefix for modules?
7403 # Do we need a version for libraries?
7406 # Whether dlopen is supported.
7407 dlopen_support
=unknown
7409 # Whether dlopen of programs is supported.
7412 # Whether dlopen of statically linked programs is supported.
7413 dlopen_self_static
=unknown
7415 # Compiler flag to prevent dynamic linking.
7416 link_static_flag
="-static"
7418 # Compiler flag to turn off builtin functions.
7419 no_builtin_flag
=" -fno-builtin"
7421 # Compiler flag to allow reflexive dlopens.
7422 export_dynamic_flag_spec
="\${wl}--export-dynamic"
7424 # Compiler flag to generate shared objects directly from archives.
7425 whole_archive_flag_spec
="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
7427 # Compiler flag to generate thread-safe objects.
7428 thread_safe_flag_spec
=""
7430 # Library versioning type.
7433 # Format of library name prefix.
7434 libname_spec
="lib\$name"
7436 # List of archive names. First name is the real one, the rest are links.
7437 # The last name is the one that the linker finds with -lNAME.
7438 library_names_spec
="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
7440 # The coded name of the library, if different from the real name.
7441 soname_spec
="\${libname}\${release}\${shared_ext}\$major"
7443 # Commands used to build and install an old-style archive.
7445 old_archive_cmds
="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
7446 old_postinstall_cmds
="chmod 644 \$oldlib~\$RANLIB \$oldlib"
7447 old_postuninstall_cmds
=""
7449 # Create an old-style archive from a shared archive.
7450 old_archive_from_new_cmds
=""
7452 # Create a temporary old-style archive to link instead of a shared archive.
7453 old_archive_from_expsyms_cmds
=""
7455 # Commands used to build and install a shared archive.
7456 archive_cmds
="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
7457 archive_expsym_cmds
="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
7459 postuninstall_cmds
=""
7461 # Commands used to build a loadable module (assumed same as above if empty)
7463 module_expsym_cmds
=""
7465 # Commands to strip libraries.
7466 old_striplib
="strip --strip-debug"
7467 striplib
="strip --strip-unneeded"
7469 # Dependencies to place before the objects being linked to create a
7471 predep_objects
="/usr/lib/gcc/i586-suse-linux/4.3/../../../crti.o /usr/lib/gcc/i586-suse-linux/4.3/crtbeginS.o"
7473 # Dependencies to place after the objects being linked to create a
7475 postdep_objects
="/usr/lib/gcc/i586-suse-linux/4.3/crtendS.o /usr/lib/gcc/i586-suse-linux/4.3/../../../crtn.o"
7477 # Dependencies to place before the objects being linked to create a
7481 # Dependencies to place after the objects being linked to create a
7483 postdeps
="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
7485 # The directories searched by this compiler when creating a shared
7487 compiler_lib_search_dirs
="/usr/lib/gcc/i586-suse-linux/4.3 /usr/lib/gcc/i586-suse-linux/4.3 /usr/lib/gcc/i586-suse-linux/4.3/../../../../i586-suse-linux/lib /usr/lib/gcc/i586-suse-linux/4.3/../../.."
7489 # The library search path used internally by the compiler when linking
7491 compiler_lib_search_path
="-L/usr/lib/gcc/i586-suse-linux/4.3 -L/usr/lib/gcc/i586-suse-linux/4.3 -L/usr/lib/gcc/i586-suse-linux/4.3/../../../../i586-suse-linux/lib -L/usr/lib/gcc/i586-suse-linux/4.3/../../.."
7493 # Method to check whether dependent libraries are shared objects.
7494 deplibs_check_method
="pass_all"
7496 # Command to use when deplibs_check_method == file_magic.
7497 file_magic_cmd
="\$MAGIC_CMD"
7499 # Flag that allows shared libraries with undefined symbols to be built.
7500 allow_undefined_flag
=""
7502 # Flag that forces no undefined symbols.
7503 no_undefined_flag
=""
7505 # Commands used to finish a libtool library installation in a directory.
7506 finish_cmds
="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
7508 # Same as above, but a single script fragment to be evaled but not shown.
7511 # Take the output of nm and produce a listing of raw symbols and C names.
7512 global_symbol_pipe
="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
7514 # Transform the output of nm in a proper C declaration
7515 global_symbol_to_cdecl
="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
7517 # Transform the output of nm in a C name address pair
7518 global_symbol_to_c_name_address
="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
7520 # This is the shared library runtime path variable.
7521 runpath_var
=LD_RUN_PATH
7523 # This is the shared library path variable.
7524 shlibpath_var
=LD_LIBRARY_PATH
7526 # Is shlibpath searched before the hard-coded library search path?
7527 shlibpath_overrides_runpath
=no
7529 # How to hardcode a shared library path into an executable.
7530 hardcode_action
=immediate
7532 # Whether we should hardcode library paths into libraries.
7533 hardcode_into_libs
=yes
7535 # Flag to hardcode $libdir into a binary during linking.
7536 # This must work even if $libdir does not exist.
7537 hardcode_libdir_flag_spec
="\${wl}--rpath \${wl}\$libdir"
7539 # If ld is used when linking, flag to hardcode $libdir into
7540 # a binary during linking. This must work even if $libdir does
7542 hardcode_libdir_flag_spec_ld
=""
7544 # Whether we need a single -rpath flag with a separated argument.
7545 hardcode_libdir_separator
=""
7547 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
7551 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
7555 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
7556 # the resulting binary.
7557 hardcode_shlibpath_var
=unsupported
7559 # Set to yes if building a shared library automatically hardcodes DIR into the library
7560 # and all subsequent libraries and executables linked against it.
7561 hardcode_automatic
=no
7563 # Variables whose values should be saved in libtool wrapper scripts and
7564 # restored at relink time.
7565 variables_saved_for_relink
="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
7567 # Whether libtool must link a program against all its dependency libraries.
7568 link_all_deplibs
=unknown
7570 # Compile-time system search path for libraries
7571 sys_lib_search_path_spec
="/usr/lib/gcc/i586-suse-linux/4.3 /usr/i586-suse-linux/lib /usr/lib /lib"
7573 # Run-time system search path for libraries
7574 sys_lib_dlsearch_path_spec
="/lib /usr/lib /usr/X11R6/lib/Xaw3d /usr/X11R6/lib /usr/lib/Xaw3d /usr/i386-suse-linux/lib /usr/local/lib /opt/kde3/lib /usr/lib/graphviz /usr/lib/graphviz/sharp /usr/lib/graphviz/java /usr/lib/graphviz/perl /usr/lib/graphviz/php /usr/lib/graphviz/ocaml /usr/lib/graphviz/python /usr/lib/graphviz/lua /usr/lib/graphviz/tcl /usr/lib/graphviz/guile /usr/lib/graphviz/ruby "
7576 # Fix the shell variable $srcfile for the compiler.
7579 # Set to yes if exported symbols are required.
7580 always_export_symbols
=no
7582 # The commands to list exported symbols.
7583 export_symbols_cmds
="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
7585 # The commands to extract the exported symbol list from a shared archive.
7586 extract_expsyms_cmds
=""
7588 # Symbols that should not be listed in the preloaded symbols.
7589 exclude_expsyms
="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
7591 # Symbols that must always be exported.
7594 # ### END LIBTOOL TAG CONFIG: CXX