3 # libtoolT - Provide generalized library-building support services.
4 # Generated automatically by (GNU fuseiso 20070708)
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
8 # Free Software Foundation, Inc.
10 # This file is part of GNU Libtool:
11 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
13 # This program is free software; you can redistribute it and/or modify
14 # it under the terms of the GNU General Public License as published by
15 # the Free Software Foundation; either version 2 of the License, or
16 # (at your option) any later version.
18 # This program is distributed in the hope that it will be useful, but
19 # WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 # General Public License for more details.
23 # You should have received a copy of the GNU General Public License
24 # along with this program; if not, write to the Free Software
25 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27 # As a special exception to the GNU General Public License, if you
28 # distribute this file as part of a program that contains a
29 # configuration script generated by Autoconf, you may include it under
30 # the same distribution terms that you use for the rest of that program.
32 # A sed program that does not truncate output.
35 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
36 Xsed
="/bin/sed -e 1s/^X//"
38 # The HP-UX ksh and POSIX shell print the target directory to stdout
40 (unset CDPATH
) >/dev
/null
2>&1 && unset CDPATH
42 # The names of the tagged configurations supported by this script.
45 # ### BEGIN LIBTOOL CONFIG
47 # Libtool was configured on host ubuntu:
49 # Shell to use when invoking shell scripts.
52 # Whether or not to build shared libraries.
53 build_libtool_libs
=yes
55 # Whether or not to build static libraries.
58 # Whether or not to add -lc for building shared libraries.
59 build_libtool_need_lc
=no
61 # Whether or not to disallow shared libs when runtime libs are static
62 allow_libtool_libs_with_static_runtimes
=no
64 # Whether or not to optimize for fast installation.
69 host=i686-pc-linux-gnu
74 build
=i686-pc-linux-gnu
77 # An echo program that does not interpret backslashes.
87 # LTCC compiler flags.
90 # A language-specific compiler.
93 # Is the compiler the GNU C compiler?
99 # The linker used to build libraries.
102 # Whether we need hard or soft links.
105 # A BSD-compatible nm program.
108 # A symbol stripping program
111 # Used to examine libraries when file_magic_cmd begins "file"
114 # Used on cygwin: DLL creation program.
117 # Used on cygwin: object dumper.
120 # Used on cygwin: assembler.
123 # The name of the directory that contains temporary libtool files.
126 # How to create reloadable object files.
128 reload_cmds
="\$LD\$reload_flag -o \$output\$reload_objs"
130 # How to pass a linker flag through the compiler.
133 # Object file suffix (normally "o").
136 # Old archive suffix (normally "a").
139 # Shared library suffix (normally ".so").
142 # Executable file suffix (normally "").
145 # Additional compiler flags for building library objects.
146 pic_flag
=" -fPIC -DPIC"
149 # What is the maximum length of a command?
152 # Does compiler simultaneously support -c and -o options?
155 # Must we lock files when doing compilation?
158 # Do we need the lib prefix for modules?
161 # Do we need a version for libraries?
164 # Whether dlopen is supported.
165 dlopen_support
=unknown
167 # Whether dlopen of programs is supported.
170 # Whether dlopen of statically linked programs is supported.
171 dlopen_self_static
=unknown
173 # Compiler flag to prevent dynamic linking.
174 link_static_flag
="-static"
176 # Compiler flag to turn off builtin functions.
177 no_builtin_flag
=" -fno-builtin"
179 # Compiler flag to allow reflexive dlopens.
180 export_dynamic_flag_spec
="\${wl}--export-dynamic"
182 # Compiler flag to generate shared objects directly from archives.
183 whole_archive_flag_spec
="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
185 # Compiler flag to generate thread-safe objects.
186 thread_safe_flag_spec
=""
188 # Library versioning type.
191 # Format of library name prefix.
192 libname_spec
="lib\$name"
194 # List of archive names. First name is the real one, the rest are links.
195 # The last name is the one that the linker finds with -lNAME.
196 library_names_spec
="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
198 # The coded name of the library, if different from the real name.
199 soname_spec
="\${libname}\${release}\${shared_ext}\$major"
201 # Commands used to build and install an old-style archive.
203 old_archive_cmds
="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
204 old_postinstall_cmds
="chmod 644 \$oldlib~\$RANLIB \$oldlib"
205 old_postuninstall_cmds
=""
207 # Create an old-style archive from a shared archive.
208 old_archive_from_new_cmds
=""
210 # Create a temporary old-style archive to link instead of a shared archive.
211 old_archive_from_expsyms_cmds
=""
213 # Commands used to build and install a shared archive.
214 archive_cmds
="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
215 archive_expsym_cmds
="\$echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
216 cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
217 \$echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
218 \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
220 postuninstall_cmds
=""
222 # Commands used to build a loadable module (assumed same as above if empty)
224 module_expsym_cmds
=""
226 # Commands to strip libraries.
227 old_striplib
="strip --strip-debug"
228 striplib
="strip --strip-unneeded"
230 # Dependencies to place before the objects being linked to create a
234 # Dependencies to place after the objects being linked to create a
238 # Dependencies to place before the objects being linked to create a
242 # Dependencies to place after the objects being linked to create a
246 # The library search path used internally by the compiler when linking
248 compiler_lib_search_path
=""
250 # Method to check whether dependent libraries are shared objects.
251 deplibs_check_method
="pass_all"
253 # Command to use when deplibs_check_method == file_magic.
254 file_magic_cmd
="\$MAGIC_CMD"
256 # Flag that allows shared libraries with undefined symbols to be built.
257 allow_undefined_flag
=""
259 # Flag that forces no undefined symbols.
262 # Commands used to finish a libtool library installation in a directory.
263 finish_cmds
="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
265 # Same as above, but a single script fragment to be evaled but not shown.
268 # Take the output of nm and produce a listing of raw symbols and C names.
269 global_symbol_pipe
="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
271 # Transform the output of nm in a proper C declaration
272 global_symbol_to_cdecl
="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
274 # Transform the output of nm in a C name address pair
275 global_symbol_to_c_name_address
="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
277 # This is the shared library runtime path variable.
278 runpath_var
=LD_RUN_PATH
280 # This is the shared library path variable.
281 shlibpath_var
=LD_LIBRARY_PATH
283 # Is shlibpath searched before the hard-coded library search path?
284 shlibpath_overrides_runpath
=no
286 # How to hardcode a shared library path into an executable.
287 hardcode_action
=immediate
289 # Whether we should hardcode library paths into libraries.
290 hardcode_into_libs
=yes
292 # Flag to hardcode $libdir into a binary during linking.
293 # This must work even if $libdir does not exist.
294 hardcode_libdir_flag_spec
="\${wl}--rpath \${wl}\$libdir"
296 # If ld is used when linking, flag to hardcode $libdir into
297 # a binary during linking. This must work even if $libdir does
299 hardcode_libdir_flag_spec_ld
=""
301 # Whether we need a single -rpath flag with a separated argument.
302 hardcode_libdir_separator
=""
304 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
308 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
312 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
313 # the resulting binary.
314 hardcode_shlibpath_var
=unsupported
316 # Set to yes if building a shared library automatically hardcodes DIR into the library
317 # and all subsequent libraries and executables linked against it.
318 hardcode_automatic
=no
320 # Variables whose values should be saved in libtool wrapper scripts and
321 # restored at relink time.
322 variables_saved_for_relink
="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
324 # Whether libtool must link a program against all its dependency libraries.
325 link_all_deplibs
=unknown
327 # Compile-time system search path for libraries
328 sys_lib_search_path_spec
="/usr/lib/gcc/i486-linux-gnu/4.4.3 /usr/lib /lib /usr/lib/i486-linux-gnu"
330 # Run-time system search path for libraries
331 sys_lib_dlsearch_path_spec
="/lib /usr/lib /usr/lib/nvidia-current /lib/i486-linux-gnu /usr/lib/i486-linux-gnu /usr/lib/alsa-lib /usr/local/lib "
333 # Fix the shell variable $srcfile for the compiler.
336 # Set to yes if exported symbols are required.
337 always_export_symbols
=no
339 # The commands to list exported symbols.
340 export_symbols_cmds
="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
342 # The commands to extract the exported symbol list from a shared archive.
343 extract_expsyms_cmds
=""
345 # Symbols that should not be listed in the preloaded symbols.
346 exclude_expsyms
="_GLOBAL_OFFSET_TABLE_"
348 # Symbols that must always be exported.
351 # ### END LIBTOOL CONFIG
353 # ltmain.sh - Provide generalized library-building support services.
354 # NOTE: Changing this file will not affect anything until you rerun configure.
356 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
357 # 2007 Free Software Foundation, Inc.
358 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
360 # This program is free software; you can redistribute it and/or modify
361 # it under the terms of the GNU General Public License as published by
362 # the Free Software Foundation; either version 2 of the License, or
363 # (at your option) any later version.
365 # This program is distributed in the hope that it will be useful, but
366 # WITHOUT ANY WARRANTY; without even the implied warranty of
367 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
368 # General Public License for more details.
370 # You should have received a copy of the GNU General Public License
371 # along with this program; if not, write to the Free Software
372 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
374 # As a special exception to the GNU General Public License, if you
375 # distribute this file as part of a program that contains a
376 # configuration script generated by Autoconf, you may include it under
377 # the same distribution terms that you use for the rest of that program.
381 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
382 # is ksh but when the shell is invoked as "sh" and the current value of
383 # the _XPG environment variable is not equal to 1 (one), the special
384 # positional parameter $0, within a function call, is the name of the
388 # The name of this program:
389 progname
=`echo "$progpath" | $SED $basename`
399 TIMESTAMP
=" (1.1220.2.437 2007/02/17 09:08:45)"
401 # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
402 if test -n "${ZSH_VERSION+set}" && (emulate sh
) >/dev
/null
2>&1; then
405 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
406 # is contrary to our usage. Disable this feature.
407 alias -g '${1+"$@"}'='"$@"'
410 case `(set -o) 2>/dev/null` in *posix
*) set -o posix
;; esac
412 BIN_SH
=xpg4
; export BIN_SH
# for Tru64
413 DUALCASE
=1; export DUALCASE
# for MKS sh
415 # Check that we have a working $echo.
416 if test "X$1" = X--no-reexec
; then
417 # Discard the --no-reexec flag, and continue.
419 elif test "X$1" = X--fallback-echo
; then
420 # Avoid inline document here, it may be left over
422 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
423 # Yippee, $echo works!
426 # Restart under the correct shell, and then maybe $echo will work.
427 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
430 if test "X$1" = X--fallback-echo
; then
431 # used as fallback echo
440 help="Try \`$progname --help' for more information."
441 magic
="%%%MAGIC variable%%%"
446 # Sed substitution that helps us do robust quoting. It backslashifies
447 # metacharacters that are still active within double-quoted strings.
448 Xsed
="${SED}"' -e 1s/^X//'
449 sed_quote_subst
='s/\([\\`\\"$\\\\]\)/\\\1/g'
450 # test EBCDIC or ASCII
451 case `echo X|tr X '\101'` in
452 A
) # ASCII based system
453 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
455 NL2SP
='tr \015\012 \040\040'
457 *) # EBCDIC based system
459 NL2SP
='tr \r\n \100\100'
464 # Only set LANG and LC_ALL to C if already set.
465 # These must not be set unconditionally because not all systems understand
466 # e.g. LANG=C (notably SCO).
467 # We save the old values to restore during execute mode.
468 for lt_var
in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
470 eval "if test \"\${$lt_var+set}\" = set; then
471 save_$lt_var=\$$lt_var
477 # Make sure IFS has a sensible default
482 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
483 $echo "$modename: not configured to build any kind of library" 1>&2
484 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
499 lo2o
="s/\\.lo\$/.${objext}/"
500 o2lo
="s/\\.${objext}\$/.lo/"
504 #####################################
505 # Shell function definitions:
506 # This seems to be the best place for them
508 # func_mktempdir [string]
509 # Make a temporary directory that won't clash with other running
510 # libtool processes, and avoids race conditions if possible. If
511 # given, STRING is the basename for that directory.
514 my_template
="${TMPDIR-/tmp}/${1-$progname}"
516 if test "$run" = ":"; then
517 # Return a directory name, but don't create it in dry-run mode
518 my_tmpdir
="${my_template}-$$"
521 # If mktemp works, use that first and foremost
522 my_tmpdir
=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
524 if test ! -d "$my_tmpdir"; then
525 # Failing that, at least try and use $RANDOM to avoid a race
526 my_tmpdir
="${my_template}-${RANDOM-0}$$"
528 save_mktempdir_umask
=`umask`
531 umask $save_mktempdir_umask
534 # If we're not in dry-run mode, bomb out on failure
535 test -d "$my_tmpdir" ||
{
536 $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
541 $echo "X$my_tmpdir" |
$Xsed
545 # func_win32_libid arg
546 # return the library type of file 'arg'
548 # Need a lot of goo to handle *both* DLLs and import libs
549 # Has to be a shell function in order to 'eat' the argument
550 # that is supplied when $file_magic_command is called.
553 win32_libid_type
="unknown"
554 win32_fileres
=`file -L $1 2>/dev/null`
555 case $win32_fileres in
556 *ar\ archive\ import\ library
*) # definitely import
557 win32_libid_type
="x86 archive import"
559 *ar\ archive
*) # could be an import, or static
560 if eval $OBJDUMP -f $1 |
$SED -e '10q' 2>/dev
/null | \
561 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev
/null
; then
562 win32_nmres
=`eval $NM -f posix -A $1 | \
571 import
*) win32_libid_type
="x86 archive import";;
572 *) win32_libid_type
="x86 archive static";;
577 win32_libid_type
="x86 DLL"
579 *executable
*) # but shell scripts are "executable" too...
580 case $win32_fileres in
581 *MS\ Windows\ PE\ Intel
*)
582 win32_libid_type
="x86 DLL"
587 $echo $win32_libid_type
592 # Infer tagged configuration to use if any are available and
593 # if one wasn't chosen via the "--tag" command line option.
594 # Only attempt this if the compiler in the base compile
595 # command doesn't match the default compiler.
596 # arg is usually of the form 'gcc ...'
599 if test -n "$available_tags" && test -z "$tagname"; then
603 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
607 CC_quoted
="$CC_quoted $arg"
610 # Blanks in the command may have been stripped by the calling shell,
611 # but not from the CC environment variable when configure was run.
612 " $CC "* |
"$CC "* |
" `$echo $CC` "* |
"`$echo $CC` "* |
" $CC_quoted"* |
"$CC_quoted "* |
" `$echo $CC_quoted` "* |
"`$echo $CC_quoted` "*) ;;
613 # Blanks at the start of $base_compile will cause this to fail
614 # if we don't check for them as well.
616 for z
in $available_tags; do
617 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev
/null
; then
618 # Evaluate the configuration.
619 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
622 # Double-quote args containing other shell metacharacters.
624 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
628 CC_quoted
="$CC_quoted $arg"
630 # user sometimes does CC=<HOST>-gcc so we need to match that to 'gcc'
631 trimedcc
=`echo ${CC} | $SED -e "s/${host}-//g"`
632 # and sometimes libtool has CC=<HOST>-gcc but user does CC=gcc
633 extendcc
=${host}-${CC}
634 # and sometimes libtool has CC=<OLDHOST>-gcc but user has CC=<NEWHOST>-gcc
635 # (Gentoo-specific hack because we always export $CHOST)
636 mungedcc
=${CHOST-${host}}-${trimedcc}
638 "cc "* |
" cc "* |
"${host}-cc "* |
" ${host}-cc "*|\
639 "gcc "* |
" gcc "* |
"${host}-gcc "* |
" ${host}-gcc "*)
642 "$trimedcc "* |
" $trimedcc "* |
"`$echo $trimedcc` "* |
" `$echo $trimedcc` "*|\
643 "$extendcc "* |
" $extendcc "* |
"`$echo $extendcc` "* |
" `$echo $extendcc` "*|\
644 "$mungedcc "* |
" $mungedcc "* |
"`$echo $mungedcc` "* |
" `$echo $mungedcc` "*|\
645 " $CC "* |
"$CC "* |
" `$echo $CC` "* |
"`$echo $CC` "* |
" $CC_quoted"* |
"$CC_quoted "* |
" `$echo $CC_quoted` "* |
"`$echo $CC_quoted` "*)
646 # The compiler in the base compile command matches
647 # the one in the tagged configuration.
648 # Assume this is the tagged configuration we want.
655 # If $tagname still isn't set, then no tagged configuration
656 # was found and let the user know that the "--tag" command
657 # line option must be used.
658 if test -z "$tagname"; then
659 $echo "$modename: unable to infer tagged configuration"
660 $echo "$modename: specify a tag with \`--tag'" 1>&2
663 # $echo "$modename: using $tagname tagged configuration"
671 # func_extract_an_archive dir oldlib
672 func_extract_an_archive
()
674 f_ex_an_ar_dir
="$1"; shift
675 f_ex_an_ar_oldlib
="$1"
677 $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
678 $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" ||
exit $?
679 if ($AR t
"$f_ex_an_ar_oldlib" |
sort |
sort -uc >/dev
/null
2>&1); then
682 $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
687 # func_extract_archives gentop oldlib ...
688 func_extract_archives
()
690 my_gentop
="$1"; shift
698 $show "${rm}r $my_gentop"
699 $run ${rm}r
"$my_gentop"
700 $show "$mkdir $my_gentop"
701 $run $mkdir "$my_gentop"
703 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
707 for my_xlib
in $my_oldlibs; do
708 # Extract the objects.
710 [\\/]* |
[A-Za-z
]:[\\/]*) my_xabs
="$my_xlib" ;;
711 *) my_xabs
=`pwd`"/$my_xlib" ;;
713 my_xlib
=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
716 case " $extracted_archives " in
718 extracted_serial
=`expr $extracted_serial + 1`
719 my_xlib_u
=lt
$extracted_serial-$my_xlib ;;
723 extracted_archives
="$extracted_archives $my_xlib_u"
724 my_xdir
="$my_gentop/$my_xlib_u"
726 $show "${rm}r $my_xdir"
727 $run ${rm}r
"$my_xdir"
728 $show "$mkdir $my_xdir"
729 $run $mkdir "$my_xdir"
731 if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
736 $show "Extracting $my_xabs"
737 # Do not bother doing anything if just a dry run
738 if test -z "$run"; then
739 darwin_orig_dir
=`pwd`
740 cd $my_xdir ||
exit $?
741 darwin_archive
=$my_xabs
743 darwin_base_archive
=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
744 darwin_arches
=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
745 if test -n "$darwin_arches"; then
746 darwin_arches
=`echo "$darwin_arches" | $SED -e 's/.*are://'`
748 $show "$darwin_base_archive has multiple architectures $darwin_arches"
749 for darwin_arch
in $darwin_arches ; do
750 mkdir
-p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
751 lipo
-thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
752 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
753 func_extract_an_archive
"`pwd`" "${darwin_base_archive}"
755 $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
756 done # $darwin_arches
757 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
758 darwin_filelist
=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
761 for darwin_file
in $darwin_filelist; do
762 darwin_files
=`find unfat-$$ -name $darwin_file -print | $NL2SP`
763 lipo
-create -output "$darwin_file" $darwin_files
764 done # $darwin_filelist
766 cd "$darwin_orig_dir"
768 cd "$darwin_orig_dir"
769 func_extract_an_archive
"$my_xdir" "$my_xabs"
774 func_extract_an_archive
"$my_xdir" "$my_xabs"
777 my_oldobjs
="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
779 func_extract_archives_result
="$my_oldobjs"
781 # End of Shell function definitions
782 #####################################
785 eval std_shrext
=\"$shrext_cmds\"
789 # Parse our command line options once, thoroughly.
790 while test "$#" -gt 0
796 -*=*) optarg
=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
800 # If the previous option needs an argument, assign it.
801 if test -n "$prev"; then
804 execute_dlfiles
="$execute_dlfiles $arg"
808 preserve_args
="${preserve_args}=$arg"
810 # Check whether tagname contains only valid characters
813 $echo "$progname: invalid tag name: $tagname" 1>&2
820 # Don't test for the "default" C tag, as we know, it's there, but
821 # not specially marked.
824 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev
/null
; then
825 taglist
="$taglist $tagname"
826 # Evaluate the configuration.
827 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
829 $echo "$progname: ignoring unknown tag $tagname" 1>&2
844 # Have we seen a non-optional argument yet?
852 $PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP
854 Copyright (C) 2007 Free Software Foundation, Inc.
855 This is free software; see the source for copying conditions. There is NO
856 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
861 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
862 # Now print the configurations for the tags.
863 for tagname
in $taglist; do
864 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
870 $echo "$progname: enabling shell trace mode"
872 preserve_args
="$preserve_args $arg"
881 if test "$build_libtool_libs" = yes; then
882 $echo "enable shared libraries"
884 $echo "disable shared libraries"
886 if test "$build_old_libs" = yes; then
887 $echo "enable static libraries"
889 $echo "disable static libraries"
894 --finish) mode
="finish" ;;
896 --mode) prevopt
="--mode" prev
=mode
;;
897 --mode=*) mode
="$optarg" ;;
899 --preserve-dup-deps) duplicate_deps
="yes" ;;
903 preserve_args
="$preserve_args $arg"
909 preserve_args
="$preserve_args --tag"
912 set tag
"$optarg" ${1+"$@"}
915 preserve_args
="$preserve_args --tag"
924 $echo "$modename: unrecognized option \`$arg'" 1>&2
936 if test -n "$prevopt"; then
937 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
942 case $disable_libs in
946 build_libtool_libs
=no
950 build_old_libs
=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
954 # If this variable is set in any of the actions, the command in it
955 # will be execed at the end. This prevents here-documents from being
956 # left over by shells.
959 if test -z "$show_help"; then
961 # Infer the operation mode.
962 if test -z "$mode"; then
963 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
964 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
966 *cc | cc
* |
*++ | gcc
* |
*-gcc* | g
++* | xlc
*)
978 *db |
*dbx |
*strace |
*truss
)
988 # If we have no mode, but dlfiles were specified, then do execute mode.
989 test -n "$execute_dlfiles" && mode
=execute
991 # Just use the default operation mode.
992 if test -z "$mode"; then
993 if test -n "$nonopt"; then
994 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
996 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
1003 # Only execute mode is allowed to have -dlopen flags.
1004 if test -n "$execute_dlfiles" && test "$mode" != execute
; then
1005 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
1010 # Change the help message to a mode-specific one.
1011 generic_help
="$help"
1012 help="Try \`$modename --help --mode=$mode' for more information."
1014 # These modes are in order of execution frequency so that they run quickly.
1016 # libtool compile mode
1018 modename
="$modename: compile"
1019 # Get the compilation command and the source file.
1021 srcfile
="$nonopt" # always keep a non-empty value in "srcfile"
1032 # do not "continue". Instead, add this to base_compile
1044 # Accept any command-line options.
1047 if test -n "$libobj" ; then
1048 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
1055 -static |
-prefer-pic |
-prefer-non-pic)
1066 arg_mode
=arg
# the next one goes into the "base_compile" arg list
1067 continue # The current "srcfile" will either be retained or
1068 ;; # replaced later. I would guess that would be a bug.
1071 args
=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
1073 save_ifs
="$IFS"; IFS
=','
1074 for arg
in $args; do
1077 # Double-quote args containing other shell metacharacters.
1078 # Many Bourne shells cannot handle close brackets correctly
1079 # in scan sets, so we specify it separately.
1081 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1085 lastarg
="$lastarg $arg"
1088 lastarg
=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
1090 # Add the arguments to base_compile.
1091 base_compile
="$base_compile $lastarg"
1096 # Accept the current argument as the source file.
1097 # The previous "srcfile" becomes the current argument.
1104 esac # case $arg_mode
1106 # Aesthetically quote the previous argument.
1107 lastarg
=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
1110 # Double-quote args containing other shell metacharacters.
1111 # Many Bourne shells cannot handle close brackets correctly
1112 # in scan sets, and some SunOS ksh mistreat backslash-escaping
1113 # in scan sets (worked around with variable expansion),
1114 # and furthermore cannot handle '|' '&' '(' ')' in scan sets
1115 # at all, so we specify them separately.
1116 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1117 lastarg
="\"$lastarg\""
1121 base_compile
="$base_compile $lastarg"
1126 $echo "$modename: you must specify an argument for -Xcompile"
1130 $echo "$modename: you must specify a target with \`-o'" 1>&2
1134 # Get the name of the library object.
1135 [ -z "$libobj" ] && libobj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
1139 # Recognize several different file suffixes.
1140 # If the user specifies -o file.o, it is replaced with file.lo
1150 *.class
) xform
=class
;;
1153 *.
[fF
][09]?
) xform
=[fF
][09].
;;
1155 *.java
) xform
=java
;;
1159 libobj
=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
1162 *.lo
) obj
=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
1164 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
1169 func_infer_tag
$base_compile
1171 for arg
in $later; do
1190 qlibobj
=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
1192 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1193 qlibobj
="\"$qlibobj\"" ;;
1195 test "X$libobj" != "X$qlibobj" \
1196 && $echo "X$libobj" |
grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
1197 && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
1198 objname
=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
1199 xdir
=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
1200 if test "X$xdir" = "X$obj"; then
1205 lobj
=${xdir}$objdir/$objname
1207 if test -z "$base_compile"; then
1208 $echo "$modename: you must specify a compilation command" 1>&2
1213 # Delete any leftover library objects.
1214 if test "$build_old_libs" = yes; then
1215 removelist
="$obj $lobj $libobj ${libobj}T"
1217 removelist
="$lobj $libobj ${libobj}T"
1220 $run $rm $removelist
1221 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1223 # On Cygwin there's no "real" PIC flag so we must build both object types
1225 cygwin
* | mingw
* | pw32
* | os2
*)
1229 if test "$pic_mode" = no
&& test "$deplibs_check_method" != pass_all
; then
1230 # non-PIC code in shared libraries is not supported
1234 # Calculate the filename of the output object if compiler does
1235 # not support -o with -c
1236 if test "$compiler_c_o" = no
; then
1237 output_obj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.
${objext}
1238 lockfile
="$output_obj.lock"
1239 removelist
="$removelist $output_obj $lockfile"
1240 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1247 # Lock this critical section if it is needed
1248 # We use this script file to make the link, it avoids creating a new file
1249 if test "$need_locks" = yes; then
1250 until $run ln "$srcfile" "$lockfile" 2>/dev
/null
; do
1251 $show "Waiting for $lockfile to be removed"
1254 elif test "$need_locks" = warn
; then
1255 if test -f "$lockfile"; then
1257 *** ERROR, $lockfile exists and contains:
1258 `cat $lockfile 2>/dev/null`
1260 This indicates that another process is trying to use the same
1261 temporary object file, and libtool could not work around it because
1262 your compiler does not support \`-c' and \`-o' together. If you
1263 repeat this compilation, it may succeed, by chance, but you had better
1264 avoid parallel builds (make -j) in this platform, or get a better
1267 $run $rm $removelist
1270 $echo "$srcfile" > "$lockfile"
1273 if test -n "$fix_srcfile_path"; then
1274 eval srcfile
=\"$fix_srcfile_path\"
1276 qsrcfile
=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
1278 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1279 qsrcfile
="\"$qsrcfile\"" ;;
1282 $run $rm "$libobj" "${libobj}T"
1284 # Create a libtool object file (analogous to a ".la" file),
1285 # but don't create it if we're doing a dry run.
1286 test -z "$run" && cat > ${libobj}T
<<EOF
1287 # $libobj - a libtool object file
1288 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
1290 # Please DO NOT delete this file!
1291 # It is necessary for linking the library.
1293 # Name of the PIC object.
1296 # Only build a PIC object if we are building libtool libraries.
1297 if test "$build_libtool_libs" = yes; then
1298 # Without this assignment, base_compile gets emptied.
1299 fbsd_hideous_sh_bug
=$base_compile
1301 if test "$pic_mode" != no
; then
1302 command="$base_compile $qsrcfile $pic_flag"
1304 # Don't build PIC code
1305 command="$base_compile $qsrcfile"
1308 if test ! -d "${xdir}$objdir"; then
1309 $show "$mkdir ${xdir}$objdir"
1310 $run $mkdir ${xdir}$objdir
1312 if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
1317 if test -z "$output_obj"; then
1318 # Place PIC objects in $objdir
1319 command="$command -o $lobj"
1322 $run $rm "$lobj" "$output_obj"
1325 if $run eval "$command"; then :
1327 test -n "$output_obj" && $run $rm $removelist
1331 if test "$need_locks" = warn
&&
1332 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1334 *** ERROR, $lockfile contains:
1335 `cat $lockfile 2>/dev/null`
1337 but it should contain:
1340 This indicates that another process is trying to use the same
1341 temporary object file, and libtool could not work around it because
1342 your compiler does not support \`-c' and \`-o' together. If you
1343 repeat this compilation, it may succeed, by chance, but you had better
1344 avoid parallel builds (make -j) in this platform, or get a better
1347 $run $rm $removelist
1351 # Just move the object if needed, then go on to compile the next one
1352 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1353 $show "$mv $output_obj $lobj"
1354 if $run $mv $output_obj $lobj; then :
1357 $run $rm $removelist
1362 # Append the name of the PIC object to the libtool object file.
1363 test -z "$run" && cat >> ${libobj}T
<<EOF
1364 pic_object='$objdir/$objname'
1368 # Allow error messages only from the first compilation.
1369 if test "$suppress_opt" = yes; then
1370 suppress_output
=' >/dev/null 2>&1'
1373 # No PIC object so indicate it doesn't exist in the libtool
1375 test -z "$run" && cat >> ${libobj}T
<<EOF
1381 # Only build a position-dependent object if we build old libraries.
1382 if test "$build_old_libs" = yes; then
1383 if test "$pic_mode" != yes; then
1384 # Don't build PIC code
1385 command="$base_compile $qsrcfile"
1387 command="$base_compile $qsrcfile $pic_flag"
1389 if test "$compiler_c_o" = yes; then
1390 command="$command -o $obj"
1393 # Suppress compiler output if we already did a PIC compilation.
1394 command="$command$suppress_output"
1395 $run $rm "$obj" "$output_obj"
1397 if $run eval "$command"; then :
1399 $run $rm $removelist
1403 if test "$need_locks" = warn
&&
1404 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1406 *** ERROR, $lockfile contains:
1407 `cat $lockfile 2>/dev/null`
1409 but it should contain:
1412 This indicates that another process is trying to use the same
1413 temporary object file, and libtool could not work around it because
1414 your compiler does not support \`-c' and \`-o' together. If you
1415 repeat this compilation, it may succeed, by chance, but you had better
1416 avoid parallel builds (make -j) in this platform, or get a better
1419 $run $rm $removelist
1423 # Just move the object if needed
1424 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1425 $show "$mv $output_obj $obj"
1426 if $run $mv $output_obj $obj; then :
1429 $run $rm $removelist
1434 # Append the name of the non-PIC object the libtool object file.
1435 # Only append if the libtool object file exists.
1436 test -z "$run" && cat >> ${libobj}T
<<EOF
1437 # Name of the non-PIC object.
1438 non_pic_object='$objname'
1442 # Append the name of the non-PIC object the libtool object file.
1443 # Only append if the libtool object file exists.
1444 test -z "$run" && cat >> ${libobj}T
<<EOF
1445 # Name of the non-PIC object.
1451 $run $mv "${libobj}T" "${libobj}"
1453 # Unlock the critical section if it was locked
1454 if test "$need_locks" != no
; then
1455 $run $rm "$lockfile"
1463 modename
="$modename: link"
1465 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1466 # It is impossible to link a dll without this setting, and
1467 # we shouldn't force the makefile maintainer to figure out
1468 # which system we are compiling for in order to pass an extra
1469 # flag for every libtool invocation.
1470 # allow_undefined=no
1472 # FIXME: Unfortunately, there are problems with the above when trying
1473 # to make a dll which has undefined symbols, in which case not
1474 # even a static library is built. For now, we need to specify
1475 # -no-undefined on the libtool link line when we can be certain
1476 # that all symbols are satisfied, otherwise we get a static library.
1483 libtool_args
="$nonopt"
1484 base_compile
="$nonopt $@"
1485 compile_command
="$nonopt"
1486 finalize_command
="$nonopt"
1499 lib_search_path
=`pwd`
1508 export_symbols_regex
=
1516 notinst_path
= # paths that contain not-installed libtool libraries
1517 precious_files_regex
=
1518 prefer_static_libs
=no
1531 func_infer_tag
$base_compile
1533 # We need to know -static, to get the right output filenames.
1537 -all-static |
-static |
-static-libtool-libs)
1540 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1541 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1543 if test -n "$link_static_flag"; then
1544 dlopen_self
=$dlopen_self_static
1546 prefer_static_libs
=yes
1549 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1550 dlopen_self
=$dlopen_self_static
1552 prefer_static_libs
=built
1554 -static-libtool-libs)
1555 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1556 dlopen_self
=$dlopen_self_static
1558 prefer_static_libs
=yes
1561 build_libtool_libs
=no
1568 # See if our shared archives depend on static archives.
1569 test -n "$old_archive_from_new_cmds" && build_old_libs
=yes
1571 # Go through the arguments, transforming them on the way.
1572 while test "$#" -gt 0; do
1576 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1577 qarg
=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1581 libtool_args
="$libtool_args $qarg"
1583 # If the previous option needs an argument, assign it.
1584 if test -n "$prev"; then
1587 compile_command
="$compile_command @OUTPUT@"
1588 finalize_command
="$finalize_command @OUTPUT@"
1594 if test "$preload" = no
; then
1595 # Add the symbol object into the linking commands.
1596 compile_command
="$compile_command @SYMFILE@"
1597 finalize_command
="$finalize_command @SYMFILE@"
1601 *.la |
*.lo
) ;; # We handle these cases below.
1603 if test "$dlself" = no
; then
1611 if test "$prev" = dlprefiles
; then
1613 elif test "$prev" = dlfiles
&& test "$dlopen_self" != yes; then
1623 if test "$prev" = dlfiles
; then
1624 dlfiles
="$dlfiles $arg"
1626 dlprefiles
="$dlprefiles $arg"
1634 export_symbols
="$arg"
1635 if test ! -f "$arg"; then
1636 $echo "$modename: symbol file \`$arg' does not exist"
1643 export_symbols_regex
="$arg"
1648 inst_prefix_dir
="$arg"
1653 precious_files_regex
="$arg"
1663 if test -f "$arg"; then
1666 for fil
in `cat $save_arg`
1668 # moreargs="$moreargs $fil"
1670 # A libtool-controlled object.
1672 # Check to see that this really is a libtool object.
1673 if (${SED} -e '2q' $arg |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1678 # If there is no directory component, then add one.
1680 */* |
*\\*) .
$arg ;;
1684 if test -z "$pic_object" || \
1685 test -z "$non_pic_object" ||
1686 test "$pic_object" = none
&& \
1687 test "$non_pic_object" = none
; then
1688 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1692 # Extract subdirectory from the argument.
1693 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1694 if test "X$xdir" = "X$arg"; then
1700 if test "$pic_object" != none
; then
1701 # Prepend the subdirectory the object is found in.
1702 pic_object
="$xdir$pic_object"
1704 if test "$prev" = dlfiles
; then
1705 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1706 dlfiles
="$dlfiles $pic_object"
1710 # If libtool objects are unsupported, then we need to preload.
1715 # CHECK ME: I think I busted this. -Ossama
1716 if test "$prev" = dlprefiles
; then
1717 # Preload the old-style object.
1718 dlprefiles
="$dlprefiles $pic_object"
1723 libobjs
="$libobjs $pic_object"
1728 if test "$non_pic_object" != none
; then
1729 # Prepend the subdirectory the object is found in.
1730 non_pic_object
="$xdir$non_pic_object"
1732 # A standard non-PIC object
1733 non_pic_objects
="$non_pic_objects $non_pic_object"
1734 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1735 arg
="$non_pic_object"
1738 # If the PIC object exists, use it instead.
1739 # $xdir was prepended to $pic_object above.
1740 non_pic_object
="$pic_object"
1741 non_pic_objects
="$non_pic_objects $non_pic_object"
1744 # Only an error if not doing a dry-run.
1745 if test -z "$run"; then
1746 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1751 # Extract subdirectory from the argument.
1752 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1753 if test "X$xdir" = "X$arg"; then
1759 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1760 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1761 libobjs
="$libobjs $pic_object"
1762 non_pic_objects
="$non_pic_objects $non_pic_object"
1767 $echo "$modename: link input file \`$save_arg' does not exist"
1775 # We need an absolute path.
1777 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1779 $echo "$modename: only absolute run-paths are allowed" 1>&2
1783 if test "$prev" = rpath
; then
1786 *) rpath
="$rpath $arg" ;;
1791 *) xrpath
="$xrpath $arg" ;;
1798 compiler_flags
="$compiler_flags $qarg"
1800 compile_command
="$compile_command $qarg"
1801 finalize_command
="$finalize_command $qarg"
1805 linker_flags
="$linker_flags $qarg"
1806 compiler_flags
="$compiler_flags $wl$qarg"
1808 compile_command
="$compile_command $wl$qarg"
1809 finalize_command
="$finalize_command $wl$qarg"
1813 linker_flags
="$linker_flags $qarg"
1814 compiler_flags
="$compiler_flags $qarg"
1816 compile_command
="$compile_command $qarg"
1817 finalize_command
="$finalize_command $qarg"
1825 darwin_framework|darwin_framework_skip
)
1826 test "$prev" = "darwin_framework" && compiler_flags
="$compiler_flags $arg"
1827 compile_command
="$compile_command $arg"
1828 finalize_command
="$finalize_command $arg"
1833 eval "$prev=\"\$arg\""
1838 fi # test -n "$prev"
1844 if test -n "$link_static_flag"; then
1845 compile_command
="$compile_command $link_static_flag"
1846 finalize_command
="$finalize_command $link_static_flag"
1852 # FIXME: remove this flag sometime in the future.
1853 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1877 -export-symbols |
-export-symbols-regex)
1878 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
1879 $echo "$modename: more than one -exported-symbols argument is not allowed"
1882 if test "X$arg" = "X-export-symbols"; then
1890 -framework|
-arch|
-isysroot)
1892 *" ${arg} ${1} "* | *" ${arg} ${1} "*)
1893 prev
=darwin_framework_skip
;;
1894 *) compiler_flags
="$compiler_flags $arg"
1895 prev
=darwin_framework
;;
1897 compile_command
="$compile_command $arg"
1898 finalize_command
="$finalize_command $arg"
1907 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1908 # so, if we see these flags be careful not to treat them like -L
1910 case $with_gcc/$host in
1911 no
/*-*-irix* |
/*-*-irix*)
1912 compile_command
="$compile_command $arg"
1913 finalize_command
="$finalize_command $arg"
1920 dir
=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1921 # We need an absolute path.
1923 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1925 absdir
=`cd "$dir" && pwd`
1926 if test -z "$absdir"; then
1927 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1929 notinst_path
="$notinst_path $dir"
1937 deplibs
="$deplibs -L$dir"
1938 lib_search_path
="$lib_search_path $dir"
1942 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1943 testbindir
=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1944 case :$dllsearchpath: in
1946 *) dllsearchpath
="$dllsearchpath:$dir";;
1948 case :$dllsearchpath: in
1949 *":$testbindir:"*) ;;
1950 *) dllsearchpath
="$dllsearchpath:$testbindir";;
1958 if test "X$arg" = "X-lc" ||
test "X$arg" = "X-lm"; then
1960 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-beos*)
1961 # These systems don't actually have a C or math library (as such)
1965 # These systems don't actually have a C library (as such)
1966 test "X$arg" = "X-lc" && continue
1968 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
1969 # Do not include libc due to us having libc/libc_r.
1970 test "X$arg" = "X-lc" && continue
1972 *-*-rhapsody* |
*-*-darwin1.
[012])
1973 # Rhapsody C and math libraries are in the System framework
1974 deplibs
="$deplibs -framework System"
1977 *-*-sco3.2v5
* |
*-*-sco5v6*)
1978 # Causes problems with __ctype
1979 test "X$arg" = "X-lc" && continue
1981 *-*-sysv4.2uw2
* |
*-*-sysv5* |
*-*-unixware* |
*-*-OpenUNIX*)
1982 # Compiler inserts libc in the correct place for threads to work
1983 test "X$arg" = "X-lc" && continue
1986 elif test "X$arg" = "X-lc_r"; then
1988 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
1989 # Do not include libc_r directly, use -pthread flag.
1994 deplibs
="$deplibs $arg"
1998 # Tru64 UNIX uses -model [arg] to determine the layout of C++
1999 # classes, name mangling, and exception handling.
2001 compile_command
="$compile_command $arg"
2002 compiler_flags
="$compiler_flags $arg"
2003 finalize_command
="$finalize_command $arg"
2008 -mt|
-mthreads|
-kthread|
-Kthread|
-pthread|
-pthreads|
--thread-safe|
-threads)
2009 compiler_flags
="$compiler_flags $arg"
2010 compile_command
="$compile_command $arg"
2011 finalize_command
="$finalize_command $arg"
2020 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
2021 # -r[0-9][0-9]* specifies the processor on the SGI compiler
2022 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
2023 # +DA*, +DD* enable 64-bit mode on the HP compiler
2024 # -q* pass through compiler args for the IBM compiler
2025 # -m* pass through architecture-specific compiler args for GCC
2026 # -m*, -t[45]*, -txscale* pass through architecture-specific
2027 # compiler args for GCC
2028 # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
2029 # -F/path gives path to uninstalled frameworks, gcc on darwin
2030 # @file GCC response files
2031 -64|
-mips[0-9]|
-r[0-9][0-9]*|
-xarch=*|
-xtarget=*|
+DA
*|
+DD
*|
-q*|
-m*| \
2032 -t[45]*|
-txscale*|
-p|
-pg|
--coverage|
-fprofile-*|
-F*|@
*)
2034 # Unknown arguments in both finalize_command and compile_command need
2035 # to be aesthetically quoted because they are evaled later.
2036 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2038 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2042 compile_command
="$compile_command $arg"
2043 finalize_command
="$finalize_command $arg"
2044 compiler_flags
="$compiler_flags $arg"
2060 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
2061 # The PATH hackery in wrapper scripts is required on Windows
2062 # in order for the loader to find any dlls it needs.
2063 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
2064 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
2067 *) no_install
=yes ;;
2084 -precious-files-regex)
2105 dir
=`$echo "X$arg" | $Xsed -e 's/^-R//'`
2106 # We need an absolute path.
2108 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
2110 $echo "$modename: only absolute run-paths are allowed" 1>&2
2116 *) xrpath
="$xrpath $dir" ;;
2121 -static |
-static-libtool-libs)
2122 # The effects of -static are defined in a previous loop.
2123 # We used to do the same as -all-static on platforms that
2124 # didn't have a PIC flag, but the assumption that the effects
2125 # would be equivalent was wrong. It would break on at least
2126 # Digital Unix and AIX.
2146 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
2148 save_ifs
="$IFS"; IFS
=','
2149 for flag
in $args; do
2152 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2157 compiler_flags
="$compiler_flags $flag"
2160 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
2164 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
2166 save_ifs
="$IFS"; IFS
=','
2167 for flag
in $args; do
2170 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2175 compiler_flags
="$compiler_flags $wl$flag"
2176 linker_flags
="$linker_flags $flag"
2179 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
2197 # Some other compiler flag.
2199 # Unknown arguments in both finalize_command and compile_command need
2200 # to be aesthetically quoted because they are evaled later.
2201 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2203 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2210 # A standard object.
2215 # A libtool-controlled object.
2217 # Check to see that this really is a libtool object.
2218 if (${SED} -e '2q' $arg |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
2223 # If there is no directory component, then add one.
2225 */* |
*\\*) .
$arg ;;
2229 if test -z "$pic_object" || \
2230 test -z "$non_pic_object" ||
2231 test "$pic_object" = none
&& \
2232 test "$non_pic_object" = none
; then
2233 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
2237 # Extract subdirectory from the argument.
2238 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2239 if test "X$xdir" = "X$arg"; then
2245 if test "$pic_object" != none
; then
2246 # Prepend the subdirectory the object is found in.
2247 pic_object
="$xdir$pic_object"
2249 if test "$prev" = dlfiles
; then
2250 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
2251 dlfiles
="$dlfiles $pic_object"
2255 # If libtool objects are unsupported, then we need to preload.
2260 # CHECK ME: I think I busted this. -Ossama
2261 if test "$prev" = dlprefiles
; then
2262 # Preload the old-style object.
2263 dlprefiles
="$dlprefiles $pic_object"
2268 libobjs
="$libobjs $pic_object"
2273 if test "$non_pic_object" != none
; then
2274 # Prepend the subdirectory the object is found in.
2275 non_pic_object
="$xdir$non_pic_object"
2277 # A standard non-PIC object
2278 non_pic_objects
="$non_pic_objects $non_pic_object"
2279 if test -z "$pic_object" ||
test "$pic_object" = none
; then
2280 arg
="$non_pic_object"
2283 # If the PIC object exists, use it instead.
2284 # $xdir was prepended to $pic_object above.
2285 non_pic_object
="$pic_object"
2286 non_pic_objects
="$non_pic_objects $non_pic_object"
2289 # Only an error if not doing a dry-run.
2290 if test -z "$run"; then
2291 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
2296 # Extract subdirectory from the argument.
2297 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2298 if test "X$xdir" = "X$arg"; then
2304 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
2305 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
2306 libobjs
="$libobjs $pic_object"
2307 non_pic_objects
="$non_pic_objects $non_pic_object"
2314 deplibs
="$deplibs $arg"
2315 old_deplibs
="$old_deplibs $arg"
2320 # A libtool-controlled library.
2322 if test "$prev" = dlfiles
; then
2323 # This library was specified with -dlopen.
2324 dlfiles
="$dlfiles $arg"
2326 elif test "$prev" = dlprefiles
; then
2327 # The library was specified with -dlpreopen.
2328 dlprefiles
="$dlprefiles $arg"
2331 deplibs
="$deplibs $arg"
2336 # Some other compiler argument.
2338 # Unknown arguments in both finalize_command and compile_command need
2339 # to be aesthetically quoted because they are evaled later.
2340 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2342 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2349 # Now actually substitute the argument into the commands.
2350 if test -n "$arg"; then
2351 compile_command
="$compile_command $arg"
2352 finalize_command
="$finalize_command $arg"
2354 done # argument parsing loop
2356 if test -n "$prev"; then
2357 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
2362 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
2363 eval arg
=\"$export_dynamic_flag_spec\"
2364 compile_command
="$compile_command $arg"
2365 finalize_command
="$finalize_command $arg"
2369 # calculate the name of the file, without its directory
2370 outputname
=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
2371 libobjs_save
="$libobjs"
2373 if test -n "$shlibpath_var"; then
2374 # get the directories listed in $shlibpath_var
2375 eval shlib_search_path
=\
`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2379 eval sys_lib_search_path
=\"$sys_lib_search_path_spec\"
2380 eval sys_lib_dlsearch_path
=\"$sys_lib_dlsearch_path_spec\"
2382 output_objdir
=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2383 if test "X$output_objdir" = "X$output"; then
2384 output_objdir
="$objdir"
2386 output_objdir
="$output_objdir/$objdir"
2388 # Create the object directory.
2389 if test ! -d "$output_objdir"; then
2390 $show "$mkdir $output_objdir"
2391 $run $mkdir $output_objdir
2393 if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
2398 # Determine the type of output
2401 $echo "$modename: you must specify an output file" 1>&2
2405 *.
$libext) linkmode
=oldlib
;;
2406 *.lo |
*.
$objext) linkmode
=obj
;;
2407 *.la
) linkmode
=lib
;;
2408 *) linkmode
=prog
;; # Anything else should be a program.
2412 *cygwin
* |
*mingw
* |
*pw32
*)
2413 # don't eliminate duplications in $postdeps and $predeps
2414 duplicate_compiler_generated_deps
=yes
2417 duplicate_compiler_generated_deps
=$duplicate_deps
2423 # Find all interdependent deplibs by searching for libraries
2424 # that are linked more than once (e.g. -la -lb -la)
2425 for deplib
in $deplibs; do
2426 if test "X$duplicate_deps" = "Xyes" ; then
2428 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2431 libs
="$libs $deplib"
2434 if test "$linkmode" = lib
; then
2435 libs
="$predeps $libs $compiler_lib_search_path $postdeps"
2437 # Compute libraries that are listed more than once in $predeps
2438 # $postdeps and mark them as special (i.e., whose duplicates are
2439 # not to be eliminated).
2441 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2442 for pre_post_dep
in $predeps $postdeps; do
2443 case "$pre_post_deps " in
2444 *" $pre_post_dep "*) specialdeplibs
="$specialdeplibs $pre_post_deps" ;;
2446 pre_post_deps
="$pre_post_deps $pre_post_dep"
2455 need_relink
=no
# whether we're linking any uninstalled libtool libraries
2456 notinst_deplibs
= # not-installed libtool libraries
2460 for file in $dlfiles $dlprefiles; do
2464 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2476 passes
="conv scan dlopen dlpreopen link"
2481 for pass
in $passes; do
2482 if test "$linkmode,$pass" = "lib,link" ||
2483 test "$linkmode,$pass" = "prog,scan"; then
2487 if test "$linkmode" = prog
; then
2489 dlopen
) libs
="$dlfiles" ;;
2490 dlpreopen
) libs
="$dlprefiles" ;;
2491 link
) libs
="$deplibs %DEPLIBS% $dependency_libs" ;;
2494 if test "$pass" = dlopen
; then
2495 # Collect dlpreopened libraries
2496 save_deplibs
="$deplibs"
2499 for deplib
in $libs; do
2503 -mt|
-mthreads|
-kthread|
-Kthread|
-pthread|
-pthreads|
--thread-safe|
-threads)
2504 if test "$linkmode,$pass" = "prog,link"; then
2505 compile_deplibs
="$deplib $compile_deplibs"
2506 finalize_deplibs
="$deplib $finalize_deplibs"
2508 compiler_flags
="$compiler_flags $deplib"
2513 if test "$linkmode" != lib
&& test "$linkmode" != prog
; then
2514 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2517 name
=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2518 for searchdir
in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2519 for search_ext
in .la
$std_shrext .so .a
; do
2520 # Search the libtool library
2521 lib
="$searchdir/lib${name}${search_ext}"
2522 if test -f "$lib"; then
2523 if test "$search_ext" = ".la"; then
2532 if test "$found" != yes; then
2533 # deplib doesn't seem to be a libtool library
2534 if test "$linkmode,$pass" = "prog,link"; then
2535 compile_deplibs
="$deplib $compile_deplibs"
2536 finalize_deplibs
="$deplib $finalize_deplibs"
2538 deplibs
="$deplib $deplibs"
2539 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
2542 else # deplib is a libtool library
2543 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2544 # We need to do some special things here, and not later.
2545 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2546 case " $predeps $postdeps " in
2548 if (${SED} -e '2q' $lib |
2549 grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
2553 */* |
*\\*) .
$lib ;;
2556 for l
in $old_library $library_names; do
2559 if test "X$ll" = "X$old_library" ; then # only static version available
2561 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2562 test "X$ladir" = "X$lib" && ladir
="."
2563 lib
=$ladir/$old_library
2564 if test "$linkmode,$pass" = "prog,link"; then
2565 compile_deplibs
="$deplib $compile_deplibs"
2566 finalize_deplibs
="$deplib $finalize_deplibs"
2568 deplibs
="$deplib $deplibs"
2569 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
2583 deplibs
="$deplib $deplibs"
2584 test "$pass" = conv
&& continue
2585 newdependency_libs
="$deplib $newdependency_libs"
2586 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2589 if test "$pass" = conv
; then
2590 deplibs
="$deplib $deplibs"
2593 if test "$pass" = scan
; then
2594 deplibs
="$deplib $deplibs"
2596 compile_deplibs
="$deplib $compile_deplibs"
2597 finalize_deplibs
="$deplib $finalize_deplibs"
2599 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2602 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2608 if test "$pass" = link
; then
2609 dir
=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2610 # Make sure the xrpath contains only unique directories.
2613 *) xrpath
="$xrpath $dir" ;;
2616 deplibs
="$deplib $deplibs"
2619 *.la
) lib
="$deplib" ;;
2621 if test "$pass" = conv
; then
2622 deplibs
="$deplib $deplibs"
2628 case $deplibs_check_method in
2630 set dummy
$deplibs_check_method
2631 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2632 if eval $echo \"$deplib\" 2>/dev
/null \
2634 |
$EGREP "$match_pattern_regex" > /dev
/null
; then
2642 if test "$valid_a_lib" != yes; then
2644 $echo "*** Warning: Trying to link with static lib archive $deplib."
2645 $echo "*** I have the capability to make that library automatically link in when"
2646 $echo "*** you link to this library. But I can only do this if you have a"
2647 $echo "*** shared version of the library, which you do not appear to have"
2648 $echo "*** because the file extensions .$libext of this argument makes me believe"
2649 $echo "*** that it is just a static archive that I should not used here."
2652 $echo "*** Warning: Linking the shared library $output against the"
2653 $echo "*** static library $deplib is not portable!"
2654 deplibs
="$deplib $deplibs"
2659 if test "$pass" != link
; then
2660 deplibs
="$deplib $deplibs"
2662 compile_deplibs
="$deplib $compile_deplibs"
2663 finalize_deplibs
="$deplib $finalize_deplibs"
2670 if test "$pass" = conv
; then
2671 deplibs
="$deplib $deplibs"
2672 elif test "$linkmode" = prog
; then
2673 if test "$pass" = dlpreopen ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
2674 # If there is no dlopen support or we're linking statically,
2675 # we need to preload.
2676 newdlprefiles
="$newdlprefiles $deplib"
2677 compile_deplibs
="$deplib $compile_deplibs"
2678 finalize_deplibs
="$deplib $finalize_deplibs"
2680 newdlfiles
="$newdlfiles $deplib"
2690 if test "$found" = yes ||
test -f "$lib"; then :
2692 $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
2696 # Check to see that this really is a libtool archive.
2697 if (${SED} -e '2q' $lib |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
2699 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2703 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2704 test "X$ladir" = "X$lib" && ladir
="."
2712 # If the library was installed with an old release of libtool,
2713 # it will not redefine variables installed, or shouldnotlink
2721 */* |
*\\*) .
$lib ;;
2725 if test "$linkmode,$pass" = "lib,link" ||
2726 test "$linkmode,$pass" = "prog,scan" ||
2727 { test "$linkmode" != prog
&& test "$linkmode" != lib
; }; then
2728 test -n "$dlopen" && dlfiles
="$dlfiles $dlopen"
2729 test -n "$dlpreopen" && dlprefiles
="$dlprefiles $dlpreopen"
2732 if test "$pass" = conv
; then
2733 # Only check for convenience libraries
2734 deplibs
="$lib $deplibs"
2735 if test -z "$libdir"; then
2736 if test -z "$old_library"; then
2737 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2740 # It is a libtool convenience library, so add in its objects.
2741 convenience
="$convenience $ladir/$objdir/$old_library"
2742 old_convenience
="$old_convenience $ladir/$objdir/$old_library"
2744 for deplib
in $dependency_libs; do
2745 deplibs
="$deplib $deplibs"
2746 if test "X$duplicate_deps" = "Xyes" ; then
2747 case "$tmp_libs " in
2748 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2751 tmp_libs
="$tmp_libs $deplib"
2753 elif test "$linkmode" != prog
&& test "$linkmode" != lib
; then
2754 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2761 # Get the name of the library we link against.
2763 for l
in $old_library $library_names; do
2766 if test -z "$linklib"; then
2767 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2771 # This library was specified with -dlopen.
2772 if test "$pass" = dlopen
; then
2773 if test -z "$libdir"; then
2774 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2777 if test -z "$dlname" ||
2778 test "$dlopen_support" != yes ||
2779 test "$build_libtool_libs" = no
; then
2780 # If there is no dlname, no dlopen support or we're linking
2781 # statically, we need to preload. We also need to preload any
2782 # dependent libraries so libltdl's deplib preloader doesn't
2783 # bomb out in the load deplibs phase.
2784 dlprefiles
="$dlprefiles $lib $dependency_libs"
2786 newdlfiles
="$newdlfiles $lib"
2791 # We need an absolute path.
2793 [\\/]* |
[A-Za-z
]:[\\/]*) abs_ladir
="$ladir" ;;
2795 abs_ladir
=`cd "$ladir" && pwd`
2796 if test -z "$abs_ladir"; then
2797 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2798 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2803 laname
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2805 # Find the relevant object directory and library name.
2806 if test "X$installed" = Xyes
; then
2807 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2808 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2816 test "X$hardcode_automatic" = Xyes
&& avoidtemprpath
=yes
2818 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2821 # Remove this search path later
2822 notinst_path
="$notinst_path $abs_ladir"
2824 dir
="$ladir/$objdir"
2825 absdir
="$abs_ladir/$objdir"
2826 # Remove this search path later
2827 notinst_path
="$notinst_path $abs_ladir"
2829 fi # $installed = yes
2830 name
=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2832 # This library was specified with -dlpreopen.
2833 if test "$pass" = dlpreopen
; then
2834 if test -z "$libdir"; then
2835 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2838 # Prefer using a static library (so that no silly _DYNAMIC symbols
2839 # are required to link).
2840 if test -n "$old_library"; then
2841 newdlprefiles
="$newdlprefiles $dir/$old_library"
2842 # Otherwise, use the dlname, so that lt_dlopen finds it.
2843 elif test -n "$dlname"; then
2844 newdlprefiles
="$newdlprefiles $dir/$dlname"
2846 newdlprefiles
="$newdlprefiles $dir/$linklib"
2848 fi # $pass = dlpreopen
2850 if test -z "$libdir"; then
2851 # Link the convenience library
2852 if test "$linkmode" = lib
; then
2853 deplibs
="$dir/$old_library $deplibs"
2854 elif test "$linkmode,$pass" = "prog,link"; then
2855 compile_deplibs
="$dir/$old_library $compile_deplibs"
2856 finalize_deplibs
="$dir/$old_library $finalize_deplibs"
2858 deplibs
="$lib $deplibs" # used for prog,scan pass
2864 if test "$linkmode" = prog
&& test "$pass" != link
; then
2865 newlib_search_path
="$newlib_search_path $ladir"
2866 deplibs
="$lib $deplibs"
2869 if test "$link_all_deplibs" != no ||
test -z "$library_names" ||
2870 test "$build_libtool_libs" = no
; then
2875 for deplib
in $dependency_libs; do
2877 -L*) newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2879 # Need to link against all dependency_libs?
2880 if test "$linkalldeplibs" = yes; then
2881 deplibs
="$deplib $deplibs"
2883 # Need to hardcode shared library paths
2884 # or/and link against static libraries
2885 newdependency_libs
="$deplib $newdependency_libs"
2887 if test "X$duplicate_deps" = "Xyes" ; then
2888 case "$tmp_libs " in
2889 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2892 tmp_libs
="$tmp_libs $deplib"
2895 fi # $linkmode = prog...
2897 if test "$linkmode,$pass" = "prog,link"; then
2898 if test -n "$library_names" &&
2899 { { test "$prefer_static_libs" = no ||
2900 test "$prefer_static_libs,$installed" = "built,yes"; } ||
2901 test -z "$old_library"; }; then
2902 # We need to hardcode the library path
2903 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2904 # Make sure the rpath contains only unique directories.
2905 case "$temp_rpath " in
2908 *) temp_rpath
="$temp_rpath $absdir" ;;
2912 # Hardcode the library path.
2913 # Skip directories that are in the system default run-time
2915 case " $sys_lib_dlsearch_path " in
2918 case "$compile_rpath " in
2920 *) compile_rpath
="$compile_rpath $absdir"
2924 case " $sys_lib_dlsearch_path " in
2927 case "$finalize_rpath " in
2929 *) finalize_rpath
="$finalize_rpath $libdir"
2933 fi # $linkmode,$pass = prog,link...
2935 if test "$alldeplibs" = yes &&
2936 { test "$deplibs_check_method" = pass_all ||
2937 { test "$build_libtool_libs" = yes &&
2938 test -n "$library_names"; }; }; then
2939 # We only need to search for static libraries
2944 link_static
=no
# Whether the deplib will be linked statically
2945 use_static_libs
=$prefer_static_libs
2946 if test "$use_static_libs" = built
&& test "$installed" = yes ; then
2949 if test -n "$library_names" &&
2950 { test "$use_static_libs" = no ||
test -z "$old_library"; }; then
2951 if test "$installed" = no
; then
2952 notinst_deplibs
="$notinst_deplibs $lib"
2955 # This is a shared library
2957 # Warn about portability, can't link against -module's on
2958 # some systems (darwin)
2959 if test "$shouldnotlink" = yes && test "$pass" = link
; then
2961 if test "$linkmode" = prog
; then
2962 $echo "*** Warning: Linking the executable $output against the loadable module"
2964 $echo "*** Warning: Linking the shared library $output against the loadable module"
2966 $echo "*** $linklib is not portable!"
2968 if test "$linkmode" = lib
&&
2969 test "$hardcode_into_libs" = yes; then
2970 # Hardcode the library path.
2971 # Skip directories that are in the system default run-time
2973 case " $sys_lib_dlsearch_path " in
2976 case "$compile_rpath " in
2978 *) compile_rpath
="$compile_rpath $absdir"
2982 case " $sys_lib_dlsearch_path " in
2985 case "$finalize_rpath " in
2987 *) finalize_rpath
="$finalize_rpath $libdir"
2993 if test -n "$old_archive_from_expsyms_cmds"; then
2994 # figure out the soname
2995 set dummy
$library_names
2998 libname
=`eval \\$echo \"$libname_spec\"`
2999 # use dlname if we got it. it's perfectly good, no?
3000 if test -n "$dlname"; then
3002 elif test -n "$soname_spec"; then
3006 major
=`expr $current - $age`
3010 eval soname
=\"$soname_spec\"
3015 # Make a new name for the extract_expsyms_cmds to use
3017 soname
=`$echo $soroot | ${SED} -e 's/^.*\///'`
3018 newlib
="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
3020 # If the library has no export list, then create one now
3021 if test -f "$output_objdir/$soname-def"; then :
3023 $show "extracting exported symbol list from \`$soname'"
3024 save_ifs
="$IFS"; IFS
='~'
3025 cmds
=$extract_expsyms_cmds
3026 for cmd
in $cmds; do
3030 $run eval "$cmd" ||
exit $?
3036 if test -f "$output_objdir/$newlib"; then :; else
3037 $show "generating import library for \`$soname'"
3038 save_ifs
="$IFS"; IFS
='~'
3039 cmds
=$old_archive_from_expsyms_cmds
3040 for cmd
in $cmds; do
3044 $run eval "$cmd" ||
exit $?
3048 # make sure the library variables are pointing to the new library
3051 fi # test -n "$old_archive_from_expsyms_cmds"
3053 if test "$linkmode" = prog ||
test "$mode" != relink
; then
3058 case $hardcode_action in
3059 immediate | unsupported
)
3060 if test "$hardcode_direct" = no
; then
3063 *-*-sco3.2v5.0.
[024]*) add_dir
="-L$dir" ;;
3064 *-*-sysv4*uw2
*) add_dir
="-L$dir" ;;
3065 *-*-sysv5OpenUNIX* |
*-*-sysv5UnixWare7.
[01].
[10]* | \
3066 *-*-unixware7*) add_dir
="-L$dir" ;;
3068 # if the lib is a module then we can not link against
3069 # it, someone is ignoring the new warnings I added
3070 if /usr
/bin
/file -L $add 2> /dev
/null |
3071 $EGREP ": [^:]* bundle" >/dev
/null
; then
3072 $echo "** Warning, lib $linklib is a module, not a shared library"
3073 if test -z "$old_library" ; then
3075 $echo "** And there doesn't seem to be a static archive available"
3076 $echo "** The link will probably fail, sorry"
3078 add
="$dir/$old_library"
3082 elif test "$hardcode_minus_L" = no
; then
3084 *-*-sunos*) add_shlibpath
="$dir" ;;
3088 elif test "$hardcode_shlibpath_var" = no
; then
3089 add_shlibpath
="$dir"
3096 if test "$hardcode_direct" = yes; then
3098 elif test "$hardcode_minus_L" = yes; then
3100 # Try looking first in the location we're being installed to.
3101 if test -n "$inst_prefix_dir"; then
3104 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
3109 elif test "$hardcode_shlibpath_var" = yes; then
3110 add_shlibpath
="$dir"
3119 if test "$lib_linked" != yes; then
3120 $echo "$modename: configuration error: unsupported hardcode properties"
3124 if test -n "$add_shlibpath"; then
3125 case :$compile_shlibpath: in
3126 *":$add_shlibpath:"*) ;;
3127 *) compile_shlibpath
="$compile_shlibpath$add_shlibpath:" ;;
3130 if test "$linkmode" = prog
; then
3131 test -n "$add_dir" && compile_deplibs
="$add_dir $compile_deplibs"
3132 test -n "$add" && compile_deplibs
="$add $compile_deplibs"
3134 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
3135 test -n "$add" && deplibs
="$add $deplibs"
3136 if test "$hardcode_direct" != yes && \
3137 test "$hardcode_minus_L" != yes && \
3138 test "$hardcode_shlibpath_var" = yes; then
3139 case :$finalize_shlibpath: in
3141 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
3147 if test "$linkmode" = prog ||
test "$mode" = relink
; then
3151 # Finalize command for both is simple: just hardcode it.
3152 if test "$hardcode_direct" = yes; then
3153 add
="$libdir/$linklib"
3154 elif test "$hardcode_minus_L" = yes; then
3157 elif test "$hardcode_shlibpath_var" = yes; then
3158 case :$finalize_shlibpath: in
3160 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
3163 elif test "$hardcode_automatic" = yes; then
3164 if test -n "$inst_prefix_dir" &&
3165 test -f "$inst_prefix_dir$libdir/$linklib" ; then
3166 add
="$inst_prefix_dir$libdir/$linklib"
3168 add
="$libdir/$linklib"
3171 # We cannot seem to hardcode it, guess we'll fake it.
3173 # Try looking first in the location we're being installed to.
3174 if test -n "$inst_prefix_dir"; then
3177 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
3184 if test "$linkmode" = prog
; then
3185 test -n "$add_dir" && finalize_deplibs
="$add_dir $finalize_deplibs"
3186 test -n "$add" && finalize_deplibs
="$add $finalize_deplibs"
3188 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
3189 test -n "$add" && deplibs
="$add $deplibs"
3192 elif test "$linkmode" = prog
; then
3193 # Here we assume that one of hardcode_direct or hardcode_minus_L
3194 # is not unsupported. This is valid on all known static and
3196 if test "$hardcode_direct" != unsupported
; then
3197 test -n "$old_library" && linklib
="$old_library"
3198 compile_deplibs
="$dir/$linklib $compile_deplibs"
3199 finalize_deplibs
="$dir/$linklib $finalize_deplibs"
3201 compile_deplibs
="-l$name -L$dir $compile_deplibs"
3202 finalize_deplibs
="-l$name -L$dir $finalize_deplibs"
3204 elif test "$build_libtool_libs" = yes; then
3205 # Not a shared library
3206 if test "$deplibs_check_method" != pass_all
; then
3207 # We're trying link a shared library against a static one
3208 # but the system doesn't support it.
3210 # Just print a warning and add the library to dependency_libs so
3211 # that the program can be linked against the static library.
3213 $echo "*** Warning: This system can not link to static lib archive $lib."
3214 $echo "*** I have the capability to make that library automatically link in when"
3215 $echo "*** you link to this library. But I can only do this if you have a"
3216 $echo "*** shared version of the library, which you do not appear to have."
3217 if test "$module" = yes; then
3218 $echo "*** But as you try to build a module library, libtool will still create "
3219 $echo "*** a static module, that should work as long as the dlopening application"
3220 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
3221 if test -z "$global_symbol_pipe"; then
3223 $echo "*** However, this would only work if libtool was able to extract symbol"
3224 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3225 $echo "*** not find such a program. So, this module is probably useless."
3226 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3228 if test "$build_old_libs" = no
; then
3229 build_libtool_libs
=module
3232 build_libtool_libs
=no
3236 deplibs
="$dir/$old_library $deplibs"
3239 fi # link shared/static library?
3241 if test "$linkmode" = lib
; then
3242 if test -n "$dependency_libs" &&
3243 { test "$hardcode_into_libs" != yes ||
3244 test "$build_old_libs" = yes ||
3245 test "$link_static" = yes; }; then
3246 # Extract -R from dependency_libs
3248 for libdir
in $dependency_libs; do
3250 -R*) temp_xrpath
=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
3252 *" $temp_xrpath "*) ;;
3253 *) xrpath
="$xrpath $temp_xrpath";;
3255 *) temp_deplibs
="$temp_deplibs $libdir";;
3258 dependency_libs
="$temp_deplibs"
3261 newlib_search_path
="$newlib_search_path $absdir"
3262 # Link against this library
3263 test "$link_static" = no
&& newdependency_libs
="$abs_ladir/$laname $newdependency_libs"
3264 # ... and its dependency_libs
3266 for deplib
in $dependency_libs; do
3267 newdependency_libs
="$deplib $newdependency_libs"
3268 if test "X$duplicate_deps" = "Xyes" ; then
3269 case "$tmp_libs " in
3270 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
3273 tmp_libs
="$tmp_libs $deplib"
3276 if test "$link_all_deplibs" != no
; then
3277 # Add the search paths of all dependency libraries
3278 for deplib
in $dependency_libs; do
3280 -L*) path
="$deplib" ;;
3282 dir
=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
3283 test "X$dir" = "X$deplib" && dir
="."
3284 # We need an absolute path.
3286 [\\/]* |
[A-Za-z
]:[\\/]*) absdir
="$dir" ;;
3288 absdir
=`cd "$dir" && pwd`
3289 if test -z "$absdir"; then
3290 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
3295 if grep "^installed=no" $deplib > /dev
/null
; then
3296 path
="$absdir/$objdir"
3298 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3299 if test -z "$libdir"; then
3300 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3303 if test "$absdir" != "$libdir"; then
3304 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
3311 # we do not want to link against static libs,
3312 # but need to link against shared
3313 eval deplibrary_names
=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
3314 if test -n "$deplibrary_names" ; then
3315 for tmp
in $deplibrary_names ; do
3318 if test -f "$path/$depdepl" ; then
3319 depdepl
="$path/$depdepl"
3321 # do not add paths which are already there
3322 case " $newlib_search_path " in
3324 *) newlib_search_path
="$newlib_search_path $path";;
3337 # Again, we only want to link against shared libraries
3338 eval tmp_libs
=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
3339 for tmp
in $newlib_search_path ; do
3340 if test -f "$tmp/lib$tmp_libs.dylib" ; then
3341 eval depdepl
="$tmp/lib$tmp_libs.dylib"
3352 case " $deplibs " in
3354 *) deplibs
="$path $deplibs" ;;
3356 case " $deplibs " in
3358 *) deplibs
="$depdepl $deplibs" ;;
3361 fi # link_all_deplibs != no
3363 done # for deplib in $libs
3364 dependency_libs
="$newdependency_libs"
3365 if test "$pass" = dlpreopen
; then
3366 # Link the dlpreopened libraries before other libraries
3367 for deplib
in $save_deplibs; do
3368 deplibs
="$deplib $deplibs"
3371 if test "$pass" != dlopen
; then
3372 if test "$pass" != conv
; then
3373 # Make sure lib_search_path contains only unique directories.
3375 for dir
in $newlib_search_path; do
3376 case "$lib_search_path " in
3378 *) lib_search_path
="$lib_search_path $dir" ;;
3384 if test "$linkmode,$pass" != "prog,link"; then
3387 vars
="compile_deplibs finalize_deplibs"
3389 for var
in $vars dependency_libs
; do
3390 # Add libraries to $var in reverse order
3391 eval tmp_libs
=\"\$
$var\"
3393 for deplib
in $tmp_libs; do
3394 # FIXME: Pedantically, this is the right thing to do, so
3395 # that some nasty dependency loop isn't accidentally
3397 #new_libs="$deplib $new_libs"
3398 # Pragmatically, this seems to cause very few problems in
3401 -L*) new_libs
="$deplib $new_libs" ;;
3404 # And here is the reason: when a library appears more
3405 # than once as an explicit dependence of a library, or
3406 # is implicitly linked in more than once by the
3407 # compiler, it is considered special, and multiple
3408 # occurrences thereof are not removed. Compare this
3409 # with having the same library being listed as a
3410 # dependency of multiple other libraries: in this case,
3411 # we know (pedantically, we assume) the library does not
3412 # need to be listed more than once, so we keep only the
3413 # last copy. This is not always right, but it is rare
3414 # enough that we require users that really mean to play
3415 # such unportable linking tricks to link the library
3416 # using -Wl,-lname, so that libtool does not consider it
3417 # for duplicate removal.
3418 case " $specialdeplibs " in
3419 *" $deplib "*) new_libs
="$deplib $new_libs" ;;
3421 case " $new_libs " in
3423 *) new_libs
="$deplib $new_libs" ;;
3431 for deplib
in $new_libs; do
3434 case " $tmp_libs " in
3436 *) tmp_libs
="$tmp_libs $deplib" ;;
3439 *) tmp_libs
="$tmp_libs $deplib" ;;
3442 eval $var=\"$tmp_libs\"
3445 # Last step: remove runtime libs from dependency_libs
3446 # (they stay in deplibs)
3448 for i
in $dependency_libs ; do
3449 case " $predeps $postdeps $compiler_lib_search_path " in
3454 if test -n "$i" ; then
3455 tmp_libs
="$tmp_libs $i"
3458 dependency_libs
=$tmp_libs
3460 if test "$linkmode" = prog
; then
3461 dlfiles
="$newdlfiles"
3462 dlprefiles
="$newdlprefiles"
3467 if test -n "$deplibs"; then
3468 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
3471 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3472 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3475 if test -n "$rpath"; then
3476 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3479 if test -n "$xrpath"; then
3480 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3483 if test -n "$vinfo"; then
3484 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3487 if test -n "$release"; then
3488 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3491 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
3492 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3495 # Now set the variables for building old libraries.
3496 build_libtool_libs
=no
3498 objs
="$objs$old_deplibs"
3502 # Make sure we only generate libraries of the form `libNAME.la'.
3505 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3506 eval shared_ext
=\"$shrext_cmds\"
3507 eval libname
=\"$libname_spec\"
3510 if test "$module" = no
; then
3511 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3515 if test "$need_lib_prefix" != no
; then
3516 # Add the "lib" prefix for modules if required
3517 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3518 eval shared_ext
=\"$shrext_cmds\"
3519 eval libname
=\"$libname_spec\"
3521 libname
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3526 if test -n "$objs"; then
3527 if test "$deplibs_check_method" != pass_all
; then
3528 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3532 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3533 $echo "*** objects $objs is not portable!"
3534 libobjs
="$libobjs $objs"
3538 if test "$dlself" != no
; then
3539 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3543 if test "$#" -gt 2; then
3544 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3549 if test -z "$rpath"; then
3550 if test "$build_libtool_libs" = yes; then
3551 # Building a libtool convenience library.
3552 # Some compilers have problems with a `.al' extension so
3553 # convenience libraries should have the same extension an
3554 # archive normally would.
3555 oldlibs
="$output_objdir/$libname.$libext $oldlibs"
3556 build_libtool_libs
=convenience
3560 if test -n "$vinfo"; then
3561 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3564 if test -n "$release"; then
3565 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3569 # Parse the version information argument.
3570 save_ifs
="$IFS"; IFS
=':'
3571 set dummy
$vinfo 0 0 0
3574 if test -n "$8"; then
3575 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3580 # convert absolute version numbers to libtool ages
3581 # this retains compatibility with .la files and attempts
3582 # to make the code below a bit more comprehensible
3584 case $vinfo_number in
3588 number_revision
="$4"
3590 # There are really only two kinds -- those that
3591 # use the current revision as the major version
3592 # and those that subtract age and use age as
3593 # a minor version. But, then there is irix
3594 # which has an extra 1 added just for fun
3596 case $version_type in
3597 darwin|linux|osf|windows|none
)
3598 current
=`expr $number_major + $number_minor`
3600 revision
="$number_revision"
3602 freebsd-aout|freebsd-elf|sunos
)
3603 current
="$number_major"
3604 revision
="$number_minor"
3608 current
=`expr $number_major + $number_minor - 1`
3610 revision
="$number_minor"
3621 # Check that each of the things are valid numbers.
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: CURRENT \`$current' 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: REVISION \`$revision' must be a nonnegative integer" 1>&2
3635 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3641 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]) ;;
3643 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3644 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3649 if test "$age" -gt "$current"; then
3650 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3651 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3655 # Calculate the version variables.
3659 case $version_type in
3663 # Like Linux, but with the current version available in
3664 # verstring for coding it into the library header
3665 major
=.
`expr $current - $age`
3666 versuffix
="$major.$age.$revision"
3667 # Darwin ld doesn't like 0 for these options...
3668 minor_current
=`expr $current + 1`
3669 verstring
="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3674 versuffix
=".$current.$revision";
3679 versuffix
=".$current";
3683 major
=`expr $current - $age + 1`
3685 case $version_type in
3686 nonstopux
) verstring_prefix
=nonstopux
;;
3687 *) verstring_prefix
=sgi
;;
3689 verstring
="$verstring_prefix$major.$revision"
3691 # Add in all the interfaces that we are compatible with.
3693 while test "$loop" -ne 0; do
3694 iface
=`expr $revision - $loop`
3695 loop
=`expr $loop - 1`
3696 verstring
="$verstring_prefix$major.$iface:$verstring"
3699 # Before this point, $major must not contain `.'.
3701 versuffix
="$major.$revision"
3705 major
=.
`expr $current - $age`
3706 versuffix
="$major.$age.$revision"
3710 major
=.
`expr $current - $age`
3711 versuffix
=".$current.$age.$revision"
3712 verstring
="$current.$age.$revision"
3714 # Add in all the interfaces that we are compatible with.
3716 while test "$loop" -ne 0; do
3717 iface
=`expr $current - $loop`
3718 loop
=`expr $loop - 1`
3719 verstring
="$verstring:${iface}.0"
3722 # Make executables depend on our current version.
3723 verstring
="$verstring:${current}.0"
3728 versuffix
=".$current.$revision"
3732 # Use '-' rather than '.', since we only want one
3733 # extension on DOS 8.3 filesystems.
3734 major
=`expr $current - $age`
3739 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3740 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3745 # Clear the version info if we defaulted, and they specified a release.
3746 if test -z "$vinfo" && test -n "$release"; then
3748 case $version_type in
3750 # we can't check for "0.0" in archive_cmds due to quoting
3751 # problems, so we reset it completely
3758 if test "$need_version" = no
; then
3765 # Remove version info from name if versioning should be avoided
3766 if test "$avoid_version" = yes && test "$need_version" = no
; then
3772 # Check to see if the archive will have undefined symbols.
3773 if test "$allow_undefined" = yes; then
3774 if test "$allow_undefined_flag" = unsupported
; then
3775 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3776 build_libtool_libs
=no
3780 # Don't allow undefined symbols.
3781 allow_undefined_flag
="$no_undefined_flag"
3785 if test "$mode" != relink
; then
3786 # Remove our outputs, but don't remove object files since they
3787 # may have been created when compiling PIC objects.
3789 tempremovelist
=`$echo "$output_objdir/*"`
3790 for p
in $tempremovelist; do
3794 $output_objdir/$outputname |
$output_objdir/$libname.
* |
$output_objdir/${libname}${release}.
*)
3795 if test "X$precious_files_regex" != "X"; then
3796 if echo $p |
$EGREP -e "$precious_files_regex" >/dev
/null
2>&1
3801 removelist
="$removelist $p"
3806 if test -n "$removelist"; then
3807 $show "${rm}r $removelist"
3808 $run ${rm}r
$removelist
3812 # Now set the variables for building old libraries.
3813 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience
; then
3814 oldlibs
="$oldlibs $output_objdir/$libname.$libext"
3816 # Transform .lo files to .o files.
3817 oldobjs
="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3820 # Eliminate all temporary directories.
3821 #for path in $notinst_path; do
3822 # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
3823 # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
3824 # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
3827 if test -n "$xrpath"; then
3828 # If the user specified any rpath flags, then add them.
3830 for libdir
in $xrpath; do
3831 temp_xrpath
="$temp_xrpath -R$libdir"
3832 case "$finalize_rpath " in
3834 *) finalize_rpath
="$finalize_rpath $libdir" ;;
3837 if test "$hardcode_into_libs" != yes ||
test "$build_old_libs" = yes; then
3838 dependency_libs
="$temp_xrpath $dependency_libs"
3842 # Make sure dlfiles contains only unique files that won't be dlpreopened
3843 old_dlfiles
="$dlfiles"
3845 for lib
in $old_dlfiles; do
3846 case " $dlprefiles $dlfiles " in
3848 *) dlfiles
="$dlfiles $lib" ;;
3852 # Make sure dlprefiles contains only unique files
3853 old_dlprefiles
="$dlprefiles"
3855 for lib
in $old_dlprefiles; do
3856 case "$dlprefiles " in
3858 *) dlprefiles
="$dlprefiles $lib" ;;
3862 if test "$build_libtool_libs" = yes; then
3863 if test -n "$rpath"; then
3865 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2* |
*-*-beos*)
3866 # these systems don't actually have a c library (as such)!
3868 *-*-rhapsody* |
*-*-darwin1.
[012])
3869 # Rhapsody C library is in the System framework
3870 deplibs
="$deplibs -framework System"
3873 # Don't link with libc until the a.out ld.so is fixed.
3875 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
3876 # Do not include libc due to us having libc/libc_r.
3878 *-*-sco3.2v5
* |
*-*-sco5v6*)
3879 # Causes problems with __ctype
3881 *-*-sysv4.2uw2
* |
*-*-sysv5* |
*-*-unixware* |
*-*-OpenUNIX*)
3882 # Compiler inserts libc in the correct place for threads to work
3885 # Add libc to deplibs on all other systems if necessary.
3886 if test "$build_libtool_need_lc" = "yes"; then
3887 deplibs
="$deplibs -lc"
3893 # Transform deplibs into only deplibs that can be linked in shared.
3895 libname_save
=$libname
3896 release_save
=$release
3897 versuffix_save
=$versuffix
3899 # I'm not sure if I'm treating the release correctly. I think
3900 # release should show up in the -l (ie -lgmp5) so we don't want to
3901 # add it in twice. Is that correct?
3907 case $deplibs_check_method in
3909 # Don't check for shared/static. Everything works.
3910 # This might be a little naive. We might want to check
3911 # whether the library exists or not. But this is on
3912 # osf3 & osf4 and I'm not really sure... Just
3913 # implementing what was already the behavior.
3917 # This code stresses the "libraries are programs" paradigm to its
3918 # limits. Maybe even breaks it. We compile a program, linking it
3919 # against the deplibs as a proxy for the library. Then we can check
3920 # whether they linked in statically or dynamically with ldd.
3922 cat > conftest.c
<<EOF
3923 int main() { return 0; }
3926 if $LTCC $LTCFLAGS -o conftest conftest.c
$deplibs; then
3927 ldd_output
=`ldd conftest`
3928 for i
in $deplibs; do
3929 name
=`expr $i : '-l\(.*\)'`
3930 # If $name is empty we are operating on a -L argument.
3931 if test "$name" != "" && test "$name" != "0"; then
3932 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3933 case " $predeps $postdeps " in
3935 newdeplibs
="$newdeplibs $i"
3940 if test -n "$i" ; then
3941 libname
=`eval \\$echo \"$libname_spec\"`
3942 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
3943 set dummy
$deplib_matches
3945 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3946 newdeplibs
="$newdeplibs $i"
3950 $echo "*** Warning: dynamic linker does not accept needed library $i."
3951 $echo "*** I have the capability to make that library automatically link in when"
3952 $echo "*** you link to this library. But I can only do this if you have a"
3953 $echo "*** shared version of the library, which I believe you do not have"
3954 $echo "*** because a test_compile did reveal that the linker did not use it for"
3955 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3959 newdeplibs
="$newdeplibs $i"
3963 # Error occurred in the first compile. Let's try to salvage
3964 # the situation: Compile a separate program for each library.
3965 for i
in $deplibs; do
3966 name
=`expr $i : '-l\(.*\)'`
3967 # If $name is empty we are operating on a -L argument.
3968 if test "$name" != "" && test "$name" != "0"; then
3970 if $LTCC $LTCFLAGS -o conftest conftest.c
$i; then
3971 ldd_output
=`ldd conftest`
3972 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3973 case " $predeps $postdeps " in
3975 newdeplibs
="$newdeplibs $i"
3980 if test -n "$i" ; then
3981 libname
=`eval \\$echo \"$libname_spec\"`
3982 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
3983 set dummy
$deplib_matches
3985 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3986 newdeplibs
="$newdeplibs $i"
3990 $echo "*** Warning: dynamic linker does not accept needed library $i."
3991 $echo "*** I have the capability to make that library automatically link in when"
3992 $echo "*** you link to this library. But I can only do this if you have a"
3993 $echo "*** shared version of the library, which you do not appear to have"
3994 $echo "*** because a test_compile did reveal that the linker did not use this one"
3995 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
4001 $echo "*** Warning! Library $i is needed by this library but I was not able to"
4002 $echo "*** make it link in! You will probably need to install it or some"
4003 $echo "*** library that it depends on before this library will be fully"
4004 $echo "*** functional. Installing it before continuing would be even better."
4007 newdeplibs
="$newdeplibs $i"
4013 set dummy
$deplibs_check_method
4014 file_magic_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
4015 for a_deplib
in $deplibs; do
4016 name
=`expr $a_deplib : '-l\(.*\)'`
4017 # If $name is empty we are operating on a -L argument.
4018 if test "$name" != "" && test "$name" != "0"; then
4019 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4020 case " $predeps $postdeps " in
4022 newdeplibs
="$newdeplibs $a_deplib"
4027 if test -n "$a_deplib" ; then
4028 libname
=`eval \\$echo \"$libname_spec\"`
4029 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
4030 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
4031 for potent_lib
in $potential_libs; do
4032 # Follow soft links.
4033 if ls -lLd "$potent_lib" 2>/dev
/null \
4034 |
grep " -> " >/dev
/null
; then
4037 # The statement above tries to avoid entering an
4038 # endless loop below, in case of cyclic links.
4039 # We might still enter an endless loop, since a link
4040 # loop can be closed while we follow links,
4042 potlib
="$potent_lib"
4043 while test -h "$potlib" 2>/dev
/null
; do
4044 potliblink
=`ls -ld $potlib | ${SED} 's/.* -> //'`
4046 [\\/]* |
[A-Za-z
]:[\\/]*) potlib
="$potliblink";;
4047 *) potlib
=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
4050 if eval $file_magic_cmd \"\
$potlib\" 2>/dev
/null \
4052 |
$EGREP "$file_magic_regex" > /dev
/null
; then
4053 newdeplibs
="$newdeplibs $a_deplib"
4060 if test -n "$a_deplib" ; then
4063 $echo "*** Warning: linker path does not have real file for library $a_deplib."
4064 $echo "*** I have the capability to make that library automatically link in when"
4065 $echo "*** you link to this library. But I can only do this if you have a"
4066 $echo "*** shared version of the library, which you do not appear to have"
4067 $echo "*** because I did check the linker path looking for a file starting"
4068 if test -z "$potlib" ; then
4069 $echo "*** with $libname but no candidates were found. (...for file magic test)"
4071 $echo "*** with $libname and none of the candidates passed a file format test"
4072 $echo "*** using a file magic. Last file checked: $potlib"
4076 # Add a -L argument.
4077 newdeplibs
="$newdeplibs $a_deplib"
4079 done # Gone through all deplibs.
4082 set dummy
$deplibs_check_method
4083 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
4084 for a_deplib
in $deplibs; do
4085 name
=`expr $a_deplib : '-l\(.*\)'`
4086 # If $name is empty we are operating on a -L argument.
4087 if test -n "$name" && test "$name" != "0"; then
4088 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4089 case " $predeps $postdeps " in
4091 newdeplibs
="$newdeplibs $a_deplib"
4096 if test -n "$a_deplib" ; then
4097 libname
=`eval \\$echo \"$libname_spec\"`
4098 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
4099 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
4100 for potent_lib
in $potential_libs; do
4101 potlib
="$potent_lib" # see symlink-check above in file_magic test
4102 if eval $echo \"$potent_lib\" 2>/dev
/null \
4104 |
$EGREP "$match_pattern_regex" > /dev
/null
; then
4105 newdeplibs
="$newdeplibs $a_deplib"
4112 if test -n "$a_deplib" ; then
4115 $echo "*** Warning: linker path does not have real file for library $a_deplib."
4116 $echo "*** I have the capability to make that library automatically link in when"
4117 $echo "*** you link to this library. But I can only do this if you have a"
4118 $echo "*** shared version of the library, which you do not appear to have"
4119 $echo "*** because I did check the linker path looking for a file starting"
4120 if test -z "$potlib" ; then
4121 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
4123 $echo "*** with $libname and none of the candidates passed a file format test"
4124 $echo "*** using a regex pattern. Last file checked: $potlib"
4128 # Add a -L argument.
4129 newdeplibs
="$newdeplibs $a_deplib"
4131 done # Gone through all deplibs.
4135 tmp_deplibs
=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
4136 -e 's/ -[LR][^ ]*//g'`
4137 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4138 for i
in $predeps $postdeps ; do
4139 # can't use Xsed below, because $i might contain '/'
4140 tmp_deplibs
=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
4143 if $echo "X $tmp_deplibs" |
$Xsed -e 's/[ ]//g' \
4144 |
grep .
>/dev
/null
; then
4146 if test "X$deplibs_check_method" = "Xnone"; then
4147 $echo "*** Warning: inter-library dependencies are not supported in this platform."
4149 $echo "*** Warning: inter-library dependencies are not known to be supported."
4151 $echo "*** All declared inter-library dependencies are being dropped."
4156 versuffix
=$versuffix_save
4158 release
=$release_save
4159 libname
=$libname_save
4163 *-*-rhapsody* |
*-*-darwin1.
[012])
4164 # On Rhapsody replace the C library is the System framework
4165 newdeplibs
=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
4169 if test "$droppeddeps" = yes; then
4170 if test "$module" = yes; then
4172 $echo "*** Warning: libtool could not satisfy all declared inter-library"
4173 $echo "*** dependencies of module $libname. Therefore, libtool will create"
4174 $echo "*** a static module, that should work as long as the dlopening"
4175 $echo "*** application is linked with the -dlopen flag."
4176 if test -z "$global_symbol_pipe"; then
4178 $echo "*** However, this would only work if libtool was able to extract symbol"
4179 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
4180 $echo "*** not find such a program. So, this module is probably useless."
4181 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
4183 if test "$build_old_libs" = no
; then
4184 oldlibs
="$output_objdir/$libname.$libext"
4185 build_libtool_libs
=module
4188 build_libtool_libs
=no
4191 $echo "*** The inter-library dependencies that have been dropped here will be"
4192 $echo "*** automatically added whenever a program is linked with this library"
4193 $echo "*** or is declared to -dlopen it."
4195 if test "$allow_undefined" = no
; then
4197 $echo "*** Since this library must not contain undefined symbols,"
4198 $echo "*** because either the platform does not support them or"
4199 $echo "*** it was explicitly requested with -no-undefined,"
4200 $echo "*** libtool will only create a static version of it."
4201 if test "$build_old_libs" = no
; then
4202 oldlibs
="$output_objdir/$libname.$libext"
4203 build_libtool_libs
=module
4206 build_libtool_libs
=no
4211 # Done checking deplibs!
4216 # move library search paths that coincide with paths to not yet
4217 # installed libraries to the beginning of the library search list
4219 for path
in $notinst_path; do
4220 case " $new_libs " in
4221 *" -L$path/$objdir "*) ;;
4223 case " $deplibs " in
4224 *" -L$path/$objdir "*)
4225 new_libs
="$new_libs -L$path/$objdir" ;;
4230 for deplib
in $deplibs; do
4233 case " $new_libs " in
4235 *) new_libs
="$new_libs $deplib" ;;
4238 *) new_libs
="$new_libs $deplib" ;;
4244 # All the library-specific variables (install_libdir is set above).
4249 # Test again, we may have decided not to build it any more
4250 if test "$build_libtool_libs" = yes; then
4251 if test "$hardcode_into_libs" = yes; then
4252 # Hardcode the library paths
4255 rpath
="$finalize_rpath"
4256 test "$mode" != relink
&& rpath
="$compile_rpath$rpath"
4257 for libdir
in $rpath; do
4258 if test -n "$hardcode_libdir_flag_spec"; then
4259 if test -n "$hardcode_libdir_separator"; then
4260 if test -z "$hardcode_libdirs"; then
4261 hardcode_libdirs
="$libdir"
4263 # Just accumulate the unique libdirs.
4264 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4265 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4268 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4273 eval flag
=\"$hardcode_libdir_flag_spec\"
4274 dep_rpath
="$dep_rpath $flag"
4276 elif test -n "$runpath_var"; then
4277 case "$perm_rpath " in
4279 *) perm_rpath
="$perm_rpath $libdir" ;;
4283 # Substitute the hardcoded libdirs into the rpath.
4284 if test -n "$hardcode_libdir_separator" &&
4285 test -n "$hardcode_libdirs"; then
4286 libdir
="$hardcode_libdirs"
4287 if test -n "$hardcode_libdir_flag_spec_ld"; then
4288 case $archive_cmds in
4289 *\
$LD*) eval dep_rpath
=\"$hardcode_libdir_flag_spec_ld\" ;;
4290 *) eval dep_rpath
=\"$hardcode_libdir_flag_spec\" ;;
4293 eval dep_rpath
=\"$hardcode_libdir_flag_spec\"
4296 if test -n "$runpath_var" && test -n "$perm_rpath"; then
4297 # We should set the runpath_var.
4299 for dir
in $perm_rpath; do
4302 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
4304 test -n "$dep_rpath" && deplibs
="$dep_rpath $deplibs"
4307 shlibpath
="$finalize_shlibpath"
4308 test "$mode" != relink
&& shlibpath
="$compile_shlibpath$shlibpath"
4309 if test -n "$shlibpath"; then
4310 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
4313 # Get the real and link names of the library.
4314 eval shared_ext
=\"$shrext_cmds\"
4315 eval library_names
=\"$library_names_spec\"
4316 set dummy
$library_names
4320 if test -n "$soname_spec"; then
4321 eval soname
=\"$soname_spec\"
4325 if test -z "$dlname"; then
4329 lib
="$output_objdir/$realname"
4333 linknames
="$linknames $link"
4336 # Use standard objects if they are pic
4337 test -z "$pic_flag" && libobjs
=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4339 # Prepare the list of exported symbols
4340 if test -z "$export_symbols"; then
4341 if test "$always_export_symbols" = yes ||
test -n "$export_symbols_regex"; then
4342 $show "generating symbol list for \`$libname.la'"
4343 export_symbols
="$output_objdir/$libname.exp"
4344 $run $rm $export_symbols
4345 cmds
=$export_symbols_cmds
4346 save_ifs
="$IFS"; IFS
='~'
4347 for cmd
in $cmds; do
4350 if len
=`expr "X$cmd" : ".*"` &&
4351 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
4353 $run eval "$cmd" ||
exit $?
4354 skipped_export
=false
4356 # The command line is too long to execute in one step.
4357 $show "using reloadable object file for export list..."
4359 # Break out early, otherwise skipped_export may be
4360 # set to false by a later but shorter cmd.
4365 if test -n "$export_symbols_regex"; then
4366 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
4367 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
4368 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
4369 $run eval '$mv "${export_symbols}T" "$export_symbols"'
4374 if test -n "$export_symbols" && test -n "$include_expsyms"; then
4375 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
4379 for test_deplib
in $deplibs; do
4380 case " $convenience " in
4381 *" $test_deplib "*) ;;
4383 tmp_deplibs
="$tmp_deplibs $test_deplib"
4387 deplibs
="$tmp_deplibs"
4389 if test -n "$convenience"; then
4390 if test -n "$whole_archive_flag_spec"; then
4391 save_libobjs
=$libobjs
4392 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
4394 gentop
="$output_objdir/${outputname}x"
4395 generated
="$generated $gentop"
4397 func_extract_archives
$gentop $convenience
4398 libobjs
="$libobjs $func_extract_archives_result"
4402 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
4403 eval flag
=\"$thread_safe_flag_spec\"
4404 linker_flags
="$linker_flags $flag"
4407 # Make a backup of the uninstalled library when relinking
4408 if test "$mode" = relink
; then
4409 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' ||
exit $?
4412 # Do each of the archive commands.
4413 if test "$module" = yes && test -n "$module_cmds" ; then
4414 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4415 eval test_cmds
=\"$module_expsym_cmds\"
4416 cmds
=$module_expsym_cmds
4418 eval test_cmds
=\"$module_cmds\"
4422 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4423 eval test_cmds
=\"$archive_expsym_cmds\"
4424 cmds
=$archive_expsym_cmds
4426 eval test_cmds
=\"$archive_cmds\"
4431 if test "X$skipped_export" != "X:" &&
4432 len
=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4433 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
4436 # The command line is too long to link in one step, link piecewise.
4437 $echo "creating reloadable object files..."
4439 # Save the value of $output and $libobjs because we want to
4440 # use them later. If we have whole_archive_flag_spec, we
4441 # want to use save_libobjs as it was before
4442 # whole_archive_flag_spec was expanded, because we can't
4443 # assume the linker understands whole_archive_flag_spec.
4444 # This may have to be revisited, in case too many
4445 # convenience libraries get linked in and end up exceeding
4447 if test -z "$convenience" ||
test -z "$whole_archive_flag_spec"; then
4448 save_libobjs
=$libobjs
4451 output_la
=`$echo "X$output" | $Xsed -e "$basename"`
4453 # Clear the reloadable object creation command queue and
4454 # initialize k to one.
4461 output
=$output_objdir/$output_la-${k}.
$objext
4462 # Loop over the list of objects to be linked.
4463 for obj
in $save_libobjs
4465 eval test_cmds
=\"$reload_cmds $objlist $last_robj\"
4466 if test "X$objlist" = X ||
4467 { len
=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4468 test "$len" -le "$max_cmd_len"; }; then
4469 objlist
="$objlist $obj"
4471 # The command $test_cmds is almost too long, add a
4472 # command to the queue.
4473 if test "$k" -eq 1 ; then
4474 # The first file doesn't have a previous command to add.
4475 eval concat_cmds
=\"$reload_cmds $objlist $last_robj\"
4477 # All subsequent reloadable object files will link in
4478 # the last one created.
4479 eval concat_cmds
=\"\
$concat_cmds~
$reload_cmds $objlist $last_robj\"
4481 last_robj
=$output_objdir/$output_la-${k}.
$objext
4483 output
=$output_objdir/$output_la-${k}.
$objext
4488 # Handle the remaining objects by creating one last
4489 # reloadable object file. All subsequent reloadable object
4490 # files will link in the last one created.
4491 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
4492 eval concat_cmds
=\"\
${concat_cmds}$reload_cmds $objlist $last_robj\"
4494 if ${skipped_export-false}; then
4495 $show "generating symbol list for \`$libname.la'"
4496 export_symbols
="$output_objdir/$libname.exp"
4497 $run $rm $export_symbols
4499 # Append the command to create the export file.
4500 eval concat_cmds
=\"\
$concat_cmds~
$export_symbols_cmds\"
4503 # Set up a command to remove the reloadable object files
4504 # after they are used.
4506 while test "$i" -lt "$k"
4509 delfiles
="$delfiles $output_objdir/$output_la-${i}.$objext"
4512 $echo "creating a temporary reloadable object file: $output"
4514 # Loop through the commands generated above and execute them.
4515 save_ifs
="$IFS"; IFS
='~'
4516 for cmd
in $concat_cmds; do
4519 $run eval "$cmd" ||
exit $?
4524 # Restore the value of output.
4527 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4528 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
4530 # Expand the library linking commands again to reset the
4531 # value of $libobjs for piecewise linking.
4533 # Do each of the archive commands.
4534 if test "$module" = yes && test -n "$module_cmds" ; then
4535 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4536 cmds
=$module_expsym_cmds
4541 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4542 cmds
=$archive_expsym_cmds
4548 # Append the command to remove the reloadable object files
4549 # to the just-reset $cmds.
4550 eval cmds
=\"\
$cmds~\
$rm $delfiles\"
4552 save_ifs
="$IFS"; IFS
='~'
4553 for cmd
in $cmds; do
4557 $run eval "$cmd" ||
{
4560 # Restore the uninstalled library and exit
4561 if test "$mode" = relink
; then
4562 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
4570 # Restore the uninstalled library and exit
4571 if test "$mode" = relink
; then
4572 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' ||
exit $?
4574 if test -n "$convenience"; then
4575 if test -z "$whole_archive_flag_spec"; then
4576 $show "${rm}r $gentop"
4577 $run ${rm}r
"$gentop"
4584 # Create links to the real library.
4585 for linkname
in $linknames; do
4586 if test "$realname" != "$linkname"; then
4587 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4588 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' ||
exit $?
4592 # If -module or -export-dynamic was specified, set the dlname.
4593 if test "$module" = yes ||
test "$export_dynamic" = yes; then
4594 # On all known operating systems, these are identical.
4601 if test -n "$deplibs"; then
4602 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4605 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
4606 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4609 if test -n "$rpath"; then
4610 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4613 if test -n "$xrpath"; then
4614 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4617 if test -n "$vinfo"; then
4618 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4621 if test -n "$release"; then
4622 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4627 if test -n "$objs$old_deplibs"; then
4628 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4632 obj
=`$echo "X$output" | $Xsed -e "$lo2o"`
4640 # Delete the old objects.
4641 $run $rm $obj $libobj
4643 # Objects from convenience libraries. This assumes
4644 # single-version convenience libraries. Whenever we create
4645 # different ones for PIC/non-PIC, this we'll have to duplicate
4649 # reload_cmds runs $LD directly, so let us get rid of
4650 # -Wl from whole_archive_flag_spec and hope we can get by with
4651 # turning comma into space..
4654 if test -n "$convenience"; then
4655 if test -n "$whole_archive_flag_spec"; then
4656 eval tmp_whole_archive_flags
=\"$whole_archive_flag_spec\"
4657 reload_conv_objs
=$reload_objs\
`$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
4659 gentop
="$output_objdir/${obj}x"
4660 generated
="$generated $gentop"
4662 func_extract_archives
$gentop $convenience
4663 reload_conv_objs
="$reload_objs $func_extract_archives_result"
4667 # Create the old-style object.
4668 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
4672 save_ifs
="$IFS"; IFS
='~'
4673 for cmd
in $cmds; do
4677 $run eval "$cmd" ||
exit $?
4681 # Exit if we aren't doing a library object file.
4682 if test -z "$libobj"; then
4683 if test -n "$gentop"; then
4684 $show "${rm}r $gentop"
4691 if test "$build_libtool_libs" != yes; then
4692 if test -n "$gentop"; then
4693 $show "${rm}r $gentop"
4697 # Create an invalid libtool object if no PIC, so that we don't
4698 # accidentally link it into a program.
4699 # $show "echo timestamp > $libobj"
4700 # $run eval "echo timestamp > $libobj" || exit $?
4704 if test -n "$pic_flag" ||
test "$pic_mode" != default
; then
4705 # Only do commands if we really have different PIC objects.
4706 reload_objs
="$libobjs $reload_conv_objs"
4709 save_ifs
="$IFS"; IFS
='~'
4710 for cmd
in $cmds; do
4714 $run eval "$cmd" ||
exit $?
4719 if test -n "$gentop"; then
4720 $show "${rm}r $gentop"
4729 *cygwin
*) output
=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4731 if test -n "$vinfo"; then
4732 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4735 if test -n "$release"; then
4736 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4739 if test "$preload" = yes; then
4740 if test "$dlopen_support" = unknown
&& test "$dlopen_self" = unknown
&&
4741 test "$dlopen_self_static" = unknown
; then
4742 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4747 *-*-rhapsody* |
*-*-darwin1.
[012])
4748 # On Rhapsody replace the C library is the System framework
4749 compile_deplibs
=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4750 finalize_deplibs
=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4756 # Don't allow lazy linking, it breaks C++ global constructors
4757 if test "$tagname" = CXX
; then
4758 compile_command
="$compile_command ${wl}-bind_at_load"
4759 finalize_command
="$finalize_command ${wl}-bind_at_load"
4765 # move library search paths that coincide with paths to not yet
4766 # installed libraries to the beginning of the library search list
4768 for path
in $notinst_path; do
4769 case " $new_libs " in
4770 *" -L$path/$objdir "*) ;;
4772 case " $compile_deplibs " in
4773 *" -L$path/$objdir "*)
4774 new_libs
="$new_libs -L$path/$objdir" ;;
4779 for deplib
in $compile_deplibs; do
4782 case " $new_libs " in
4784 *) new_libs
="$new_libs $deplib" ;;
4787 *) new_libs
="$new_libs $deplib" ;;
4790 compile_deplibs
="$new_libs"
4793 compile_command
="$compile_command $compile_deplibs"
4794 finalize_command
="$finalize_command $finalize_deplibs"
4796 if test -n "$rpath$xrpath"; then
4797 # If the user specified any rpath flags, then add them.
4798 for libdir
in $rpath $xrpath; do
4799 # This is the magic to use -rpath.
4800 case "$finalize_rpath " in
4802 *) finalize_rpath
="$finalize_rpath $libdir" ;;
4807 # Now hardcode the library paths
4810 for libdir
in $compile_rpath $finalize_rpath; do
4811 if test -n "$hardcode_libdir_flag_spec"; then
4812 if test -n "$hardcode_libdir_separator"; then
4813 if test -z "$hardcode_libdirs"; then
4814 hardcode_libdirs
="$libdir"
4816 # Just accumulate the unique libdirs.
4817 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4818 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4821 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4826 eval flag
=\"$hardcode_libdir_flag_spec\"
4827 rpath
="$rpath $flag"
4829 elif test -n "$runpath_var"; then
4830 case "$perm_rpath " in
4832 *) perm_rpath
="$perm_rpath $libdir" ;;
4836 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
4837 testbindir
=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
4838 case :$dllsearchpath: in
4840 *) dllsearchpath
="$dllsearchpath:$libdir";;
4842 case :$dllsearchpath: in
4843 *":$testbindir:"*) ;;
4844 *) dllsearchpath
="$dllsearchpath:$testbindir";;
4849 # Substitute the hardcoded libdirs into the rpath.
4850 if test -n "$hardcode_libdir_separator" &&
4851 test -n "$hardcode_libdirs"; then
4852 libdir
="$hardcode_libdirs"
4853 eval rpath
=\" $hardcode_libdir_flag_spec\"
4855 compile_rpath
="$rpath"
4859 for libdir
in $finalize_rpath; do
4860 if test -n "$hardcode_libdir_flag_spec"; then
4861 if test -n "$hardcode_libdir_separator"; then
4862 if test -z "$hardcode_libdirs"; then
4863 hardcode_libdirs
="$libdir"
4865 # Just accumulate the unique libdirs.
4866 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4867 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4870 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4875 eval flag
=\"$hardcode_libdir_flag_spec\"
4876 rpath
="$rpath $flag"
4878 elif test -n "$runpath_var"; then
4879 case "$finalize_perm_rpath " in
4881 *) finalize_perm_rpath
="$finalize_perm_rpath $libdir" ;;
4885 # Substitute the hardcoded libdirs into the rpath.
4886 if test -n "$hardcode_libdir_separator" &&
4887 test -n "$hardcode_libdirs"; then
4888 libdir
="$hardcode_libdirs"
4889 eval rpath
=\" $hardcode_libdir_flag_spec\"
4891 finalize_rpath
="$rpath"
4893 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4894 # Transform all the library objects into standard objects.
4895 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4896 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4900 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
4901 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4902 dlsyms
="${outputname}S.c"
4904 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4908 if test -n "$dlsyms"; then
4912 # Discover the nlist of each of the dlfiles.
4913 nlist
="$output_objdir/${outputname}.nm"
4915 $show "$rm $nlist ${nlist}S ${nlist}T"
4916 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4918 # Parse the name list into a source file.
4919 $show "creating $output_objdir/$dlsyms"
4921 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4922 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4923 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4929 /* Prevent the only kind of declaration conflicts we can make. */
4930 #define lt_preloaded_symbols some_other_symbol
4932 /* External symbol declarations for the compiler. */\
4935 if test "$dlself" = yes; then
4936 $show "generating symbol list for \`$output'"
4938 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4940 # Add our own program objects to the symbol list.
4941 progfiles
=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4942 for arg
in $progfiles; do
4943 $show "extracting global C symbols from \`$arg'"
4944 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4947 if test -n "$exclude_expsyms"; then
4948 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4949 $run eval '$mv "$nlist"T "$nlist"'
4952 if test -n "$export_symbols_regex"; then
4953 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4954 $run eval '$mv "$nlist"T "$nlist"'
4957 # Prepare the list of exported symbols
4958 if test -z "$export_symbols"; then
4959 export_symbols
="$output_objdir/$outputname.exp"
4960 $run $rm $export_symbols
4961 $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4963 *cygwin
* |
*mingw
* )
4964 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4965 $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4969 $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4970 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4971 $run eval 'mv "$nlist"T "$nlist"'
4973 *cygwin
* |
*mingw
* )
4974 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4975 $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
4981 for arg
in $dlprefiles; do
4982 $show "extracting global C symbols from \`$arg'"
4983 name
=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4984 $run eval '$echo ": $name " >> "$nlist"'
4985 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4988 if test -z "$run"; then
4989 # Make sure we have at least an empty file.
4990 test -f "$nlist" ||
: > "$nlist"
4992 if test -n "$exclude_expsyms"; then
4993 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4994 $mv "$nlist"T
"$nlist"
4997 # Try sorting and uniquifying the output.
4998 if grep -v "^: " < "$nlist" |
4999 if sort -k 3 </dev
/null
>/dev
/null
2>&1; then
5004 uniq > "$nlist"S
; then
5007 grep -v "^: " < "$nlist" > "$nlist"S
5010 if test -f "$nlist"S
; then
5011 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
5013 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
5016 $echo >> "$output_objdir/$dlsyms" "\
5018 #undef lt_preloaded_symbols
5020 #if defined (__STDC__) && __STDC__
5021 # define lt_ptr void *
5023 # define lt_ptr char *
5027 /* The mapping between symbol names and symbols. */
5031 *cygwin
* |
*mingw
* )
5032 $echo >> "$output_objdir/$dlsyms" "\
5033 /* DATA imports from DLLs on WIN32 can't be const, because
5034 runtime relocations are performed -- see ld's documentation
5040 $echo >> "$output_objdir/$dlsyms" "\
5047 $echo >> "$output_objdir/$dlsyms" "\
5051 lt_preloaded_symbols[] =
5055 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
5057 $echo >> "$output_objdir/$dlsyms" "\
5061 /* This works around a problem in FreeBSD linker */
5062 #ifdef FREEBSD_WORKAROUND
5063 static const void *lt_preloaded_setup() {
5064 return lt_preloaded_symbols;
5074 pic_flag_for_symtable
=
5076 # compiling the symbol table file with pic_flag works around
5077 # a FreeBSD bug that causes programs to crash when -lm is
5078 # linked before any other PIC object. But we must not use
5079 # pic_flag when linking with -static. The problem exists in
5080 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
5081 *-*-freebsd2*|
*-*-freebsd3.0
*|
*-*-freebsdelf3.0
*)
5082 case "$compile_command " in
5084 *) pic_flag_for_symtable
=" $pic_flag -DFREEBSD_WORKAROUND";;
5087 case "$compile_command " in
5089 *) pic_flag_for_symtable
=" $pic_flag";;
5093 # Now compile the dynamic symbol file.
5094 $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
5095 $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' ||
exit $?
5097 # Clean up the generated files.
5098 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
5099 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
5101 # Transform the symbol file into the correct name.
5103 *cygwin
* |
*mingw
* )
5104 if test -f "$output_objdir/${outputname}.def" ; then
5105 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
5106 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $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`
5113 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
5114 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
5119 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
5124 # We keep going just in case the user didn't refer to
5125 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
5126 # really was required.
5128 # Nullify the symbol file.
5129 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
5130 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
5133 if test "$need_relink" = no ||
test "$build_libtool_libs" != yes; then
5134 # Replace the output file specification.
5135 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
5136 link_command
="$compile_command$compile_rpath"
5138 # We have no uninstalled library dependencies, so finalize right now.
5139 $show "$link_command"
5140 $run eval "$link_command"
5143 # Delete the generated files.
5144 if test -n "$dlsyms"; then
5145 $show "$rm $output_objdir/${outputname}S.${objext}"
5146 $run $rm "$output_objdir/${outputname}S.${objext}"
5152 if test -n "$shlibpath_var"; then
5153 # We should set the shlibpath_var
5155 for dir
in $temp_rpath; do
5157 [\\/]* |
[A-Za-z
]:[\\/]*)
5162 # Relative path: add a thisdir entry.
5163 rpath
="$rpath\$thisdir/$dir:"
5170 if test -n "$compile_shlibpath$finalize_shlibpath"; then
5171 compile_command
="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
5173 if test -n "$finalize_shlibpath"; then
5174 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
5179 if test -n "$runpath_var"; then
5180 if test -n "$perm_rpath"; then
5181 # We should set the runpath_var.
5183 for dir
in $perm_rpath; do
5186 compile_var
="$runpath_var=\"$rpath\$$runpath_var\" "
5188 if test -n "$finalize_perm_rpath"; then
5189 # We should set the runpath_var.
5191 for dir
in $finalize_perm_rpath; do
5194 finalize_var
="$runpath_var=\"$rpath\$$runpath_var\" "
5198 if test "$no_install" = yes; then
5199 # We don't need to create a wrapper script.
5200 link_command
="$compile_var$compile_command$compile_rpath"
5201 # Replace the output file specification.
5202 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
5203 # Delete the old output file.
5205 # Link the executable and exit
5206 $show "$link_command"
5207 $run eval "$link_command" ||
exit $?
5211 if test "$hardcode_action" = relink
; then
5212 # Fast installation is not supported
5213 link_command
="$compile_var$compile_command$compile_rpath"
5214 relink_command
="$finalize_var$finalize_command$finalize_rpath"
5216 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
5217 $echo "$modename: \`$output' will be relinked during installation" 1>&2
5219 if test "$fast_install" != no
; then
5220 link_command
="$finalize_var$compile_command$finalize_rpath"
5221 if test "$fast_install" = yes; then
5222 relink_command
=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
5224 # fast_install is set to needless
5228 link_command
="$compile_var$compile_command$compile_rpath"
5229 relink_command
="$finalize_var$finalize_command$finalize_rpath"
5233 # Replace the output file specification.
5234 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
5236 # Delete the old output files.
5237 $run $rm $output $output_objdir/$outputname $output_objdir/lt-
$outputname
5239 $show "$link_command"
5240 $run eval "$link_command" ||
exit $?
5242 # Now create the wrapper script.
5243 $show "creating $output"
5245 # Quote the relink command for shipping.
5246 if test -n "$relink_command"; then
5247 # Preserve any variables that may affect compiler behavior
5248 for var
in $variables_saved_for_relink; do
5249 if eval test -z \"\
${$var+set}\"; then
5250 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5251 elif eval var_value
=\$
$var; test -z "$var_value"; then
5252 relink_command
="$var=; export $var; $relink_command"
5254 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5255 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
5258 relink_command
="(cd `pwd`; $relink_command)"
5259 relink_command
=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
5262 # Quote $echo for shipping.
5263 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
5265 [\\/]* |
[A-Za-z
]:[\\/]*) qecho
="$SHELL $progpath --fallback-echo";;
5266 *) qecho
="$SHELL `pwd`/$progpath --fallback-echo";;
5268 qecho
=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
5270 qecho
=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
5273 # Only actually do things if our run command is non-null.
5274 if test -z "$run"; then
5275 # win32 will think the script is a binary if it has
5276 # a .exe suffix, so we strip it off here.
5278 *.exe
) output
=`$echo $output|${SED} 's,.exe$,,'` ;;
5280 # test for cygwin because mv fails w/o .exe extensions
5284 outputname
=`$echo $outputname|${SED} 's,.exe$,,'` ;;
5288 *cygwin
* |
*mingw
* )
5289 output_name
=`basename $output`
5290 output_path
=`dirname $output`
5291 cwrappersource
="$output_path/$objdir/lt-$output_name.c"
5292 cwrapper
="$output_path/$output_name.exe"
5293 $rm $cwrappersource $cwrapper
5294 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
5296 cat > $cwrappersource <<EOF
5298 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
5299 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5301 The $output program cannot be directly executed until all the libtool
5302 libraries that it depends on are installed.
5304 This wrapper executable should never be moved out of the build directory.
5305 If it is, it will not operate correctly.
5307 Currently, it simply execs the wrapper *script* "/bin/sh $output",
5308 but could eventually absorb all of the scripts functionality and
5309 exec $objdir/$outputname directly.
5312 cat >> $cwrappersource<<"EOF"
5321 #include <sys/stat.h>
5323 #if defined(PATH_MAX)
5324 # define LT_PATHMAX PATH_MAX
5325 #elif defined(MAXPATHLEN)
5326 # define LT_PATHMAX MAXPATHLEN
5328 # define LT_PATHMAX 1024
5331 #ifndef DIR_SEPARATOR
5332 # define DIR_SEPARATOR '/'
5333 # define PATH_SEPARATOR ':'
5336 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
5338 # define HAVE_DOS_BASED_FILE_SYSTEM
5339 # ifndef DIR_SEPARATOR_2
5340 # define DIR_SEPARATOR_2 '\\'
5342 # ifndef PATH_SEPARATOR_2
5343 # define PATH_SEPARATOR_2 ';'
5347 #ifndef DIR_SEPARATOR_2
5348 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
5349 #else /* DIR_SEPARATOR_2 */
5350 # define IS_DIR_SEPARATOR(ch) \
5351 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
5352 #endif /* DIR_SEPARATOR_2 */
5354 #ifndef PATH_SEPARATOR_2
5355 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
5356 #else /* PATH_SEPARATOR_2 */
5357 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
5358 #endif /* PATH_SEPARATOR_2 */
5360 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
5361 #define XFREE(stale) do { \
5362 if (stale) { free ((void *) stale); stale = 0; } \
5365 /* -DDEBUG is fairly common in CFLAGS. */
5367 #if defined DEBUGWRAPPER
5368 # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
5370 # define DEBUG(format, ...)
5373 const char *program_name = NULL;
5375 void * xmalloc (size_t num);
5376 char * xstrdup (const char *string);
5377 const char * base_name (const char *name);
5378 char * find_executable(const char *wrapper);
5379 int check_executable(const char *path);
5380 char * strendzap(char *str, const char *pat);
5381 void lt_fatal (const char *message, ...);
5384 main (int argc, char *argv[])
5389 program_name = (char *) xstrdup (base_name (argv[0]));
5390 DEBUG("(main) argv[0] : %s\n",argv[0]);
5391 DEBUG("(main) program_name : %s\n",program_name);
5392 newargz = XMALLOC(char *, argc+2);
5395 cat >> $cwrappersource <<EOF
5396 newargz[0] = (char *) xstrdup("$SHELL");
5399 cat >> $cwrappersource <<"EOF"
5400 newargz
[1] = find_executable
(argv
[0]);
5401 if (newargz
[1] == NULL
)
5402 lt_fatal
("Couldn't find %s", argv
[0]);
5403 DEBUG
("(main) found exe at : %s\n",newargz
[1]);
5404 /* we know the
script has the same name
, without the .exe
*/
5405 /* so
make sure newargz
[1] doesn
't end in .exe */
5406 strendzap(newargz[1],".exe");
5407 for (i = 1; i < argc; i++)
5408 newargz[i+1] = xstrdup(argv[i]);
5409 newargz[argc+1] = NULL;
5411 for (i=0; i<argc+1; i++)
5413 DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
5421 cat >> $cwrappersource <<EOF
5422 execv("$SHELL",(char const **)newargz);
5426 cat >> $cwrappersource <<EOF
5427 execv("$SHELL",newargz);
5432 cat >> $cwrappersource <<"EOF"
5437 xmalloc (size_t num)
5439 void * p = (void *) malloc (num);
5441 lt_fatal ("Memory exhausted");
5447 xstrdup (const char *string)
5449 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5454 base_name (const char *name)
5458 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5459 /* Skip over the disk name in MSDOS pathnames. */
5460 if (isalpha ((unsigned char)name[0]) && name[1] == ':')
5464 for (base = name; *name; name++)
5465 if (IS_DIR_SEPARATOR (*name))
5471 check_executable(const char * path)
5475 DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
5476 if ((!path) || (!*path))
5479 if ((stat (path, &st) >= 0) &&
5481 /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
5482 #if defined (S_IXOTH)
5483 ((st.st_mode & S_IXOTH) == S_IXOTH) ||
5485 #if defined (S_IXGRP)
5486 ((st.st_mode & S_IXGRP) == S_IXGRP) ||
5488 ((st.st_mode & S_IXUSR) == S_IXUSR))
5495 /* Searches for the full path of the wrapper. Returns
5496 newly allocated full path name if found, NULL otherwise */
5498 find_executable (const char* wrapper)
5503 /* static buffer for getcwd */
5504 char tmp[LT_PATHMAX + 1];
5508 DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
5510 if ((wrapper == NULL) || (*wrapper == '\
0'))
5513 /* Absolute path? */
5514 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5515 if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
5517 concat_name = xstrdup (wrapper);
5518 if (check_executable(concat_name))
5525 if (IS_DIR_SEPARATOR (wrapper[0]))
5527 concat_name = xstrdup (wrapper);
5528 if (check_executable(concat_name))
5532 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5536 for (p = wrapper; *p; p++)
5544 /* no slashes; search PATH */
5545 const char* path = getenv ("PATH");
5548 for (p = path; *p; p = p_next)
5552 for (q = p; *q; q++)
5553 if (IS_PATH_SEPARATOR(*q))
5556 p_next = (*q == '\
0' ? q : q + 1);
5559 /* empty path: current directory */
5560 if (getcwd (tmp, LT_PATHMAX) == NULL)
5561 lt_fatal ("getcwd failed");
5562 tmp_len = strlen(tmp);
5563 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5564 memcpy (concat_name, tmp, tmp_len);
5565 concat_name[tmp_len] = '/';
5566 strcpy (concat_name + tmp_len + 1, wrapper);
5570 concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
5571 memcpy (concat_name, p, p_len);
5572 concat_name[p_len] = '/';
5573 strcpy (concat_name + p_len + 1, wrapper);
5575 if (check_executable(concat_name))
5580 /* not found in PATH; assume curdir */
5582 /* Relative path | not found in path: prepend cwd */
5583 if (getcwd (tmp, LT_PATHMAX) == NULL)
5584 lt_fatal ("getcwd failed");
5585 tmp_len = strlen(tmp);
5586 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5587 memcpy (concat_name, tmp, tmp_len);
5588 concat_name[tmp_len] = '/';
5589 strcpy (concat_name + tmp_len + 1, wrapper);
5591 if (check_executable(concat_name))
5598 strendzap(char *str, const char *pat)
5602 assert(str != NULL);
5603 assert(pat != NULL);
5606 patlen = strlen(pat);
5610 str += len - patlen;
5611 if (strcmp(str, pat) == 0)
5618 lt_error_core (int exit_status, const char * mode,
5619 const char * message, va_list ap)
5621 fprintf (stderr, "%s: %s: ", program_name, mode);
5622 vfprintf (stderr, message, ap);
5623 fprintf (stderr, ".\n");
5625 if (exit_status >= 0)
5630 lt_fatal (const char *message, ...)
5633 va_start (ap, message);
5634 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5638 # we should really use a build-platform specific compiler
5639 # here, but OTOH, the wrappers (shell script and this C one)
5640 # are only useful if you want to execute the "real" binary.
5641 # Since the "real" binary is built for $host, then this
5642 # wrapper might as well be built for $host, too.
5643 $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
5647 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5652 # $output - temporary wrapper script for $objdir/$outputname
5653 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5655 # The $output program cannot be directly executed until all the libtool
5656 # libraries that it depends on are installed.
5658 # This wrapper script should never be moved out of the build directory.
5659 # If it is, it will not operate correctly.
5661 # Sed substitution that helps us do robust quoting. It backslashifies
5662 # metacharacters that are still active within double-quoted strings.
5663 Xsed='${SED} -e 1s
/^X
//'
5664 sed_quote_subst='$sed_quote_subst'
5666 # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
5667 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
5670 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
5671 # is contrary to our usage. Disable this feature.
5672 alias -g '\
${1+\"\$@\"}'='\"\$@
\"'
5673 setopt NO_GLOB_SUBST
5675 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
5677 BIN_SH=xpg4; export BIN_SH # for Tru64
5678 DUALCASE=1; export DUALCASE # for MKS sh
5680 # The HP-UX ksh and POSIX shell print the target directory to stdout
5682 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5684 relink_command=\"$relink_command\"
5686 # This environment variable determines our operation mode.
5687 if test \"\$libtool_install_magic\" = \"$magic\"; then
5688 # install mode needs the following variable:
5689 notinst_deplibs='$notinst_deplibs'
5691 # When we are sourced in execute mode, \$file and \$echo are already set.
5692 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5695 # Make sure echo works.
5696 if test \"X\$1\" = X--no-reexec; then
5697 # Discard the --no-reexec flag, and continue.
5699 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X
\t'; then
5700 # Yippee, \$echo works!
5703 # Restart under the correct shell, and then maybe \$echo will work.
5704 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5710 # Find the directory that this script lives in.
5711 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's
%/[^
/]*$
%%'\`
5712 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5714 # Follow symbolic links until we get to the real thisdir.
5715 file=\`ls -ld \"\$file\" | ${SED} -n 's
/.
*-> //p
'\`
5716 while test -n \"\$file\"; do
5717 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's
%/[^
/]*\$
%%'\`
5719 # If there was a directory component, then change thisdir.
5720 if test \"x\$destdir\" != \"x\$file\"; then
5721 case \"\$destdir\" in
5722 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5723 *) thisdir=\"\$thisdir/\$destdir\" ;;
5727 file=\`\$echo \"X\$file\" | \$Xsed -e 's
%^.
*/%%'\`
5728 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's
/.
*-> //p
'\`
5731 # Try to get the absolute directory name.
5732 absdir=\`cd \"\$thisdir\" && pwd\`
5733 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5736 if test "$fast_install" = yes; then
5738 program=lt-'$outputname'$exeext
5739 progdir=\"\$thisdir/$objdir\"
5741 if test ! -f \"\$progdir/\$program\" || \\
5742 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5743 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5745 file=\"\$\$-\$program\"
5747 if test ! -d \"\$progdir\"; then
5748 $mkdir \"\$progdir\"
5750 $rm \"\$progdir/\$file\"
5755 # relink executable if necessary
5756 if test -n \"\$relink_command\"; then
5757 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5759 $echo \"\$relink_command_output\" >&2
5760 $rm \"\$progdir/\$file\"
5765 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5766 { $rm \"\$progdir/\$program\";
5767 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5768 $rm \"\$progdir/\$file\"
5772 program='$outputname'
5773 progdir=\"\$thisdir/$objdir\"
5779 if test -f \"\$progdir/\$program\"; then"
5781 # Export our shlibpath_var if we have one.
5782 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5784 # Add our own library path to $shlibpath_var
5785 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5787 # Some systems cannot cope with colon-terminated $shlibpath_var
5788 # The second colon is a workaround for a bug in BeOS R4 sed
5789 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's
/::*\$
//'\`
5791 export $shlibpath_var
5795 # fixup the dll searchpath if we need to.
5796 if test -n "$dllsearchpath"; then
5798 # Add the dll search path components to the executable PATH
5799 PATH=$dllsearchpath:\$PATH
5804 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5805 # Run the actual program with our arguments.
5807 # Make sure env LD_LIBRARY_PATH does not mess us up
5808 if test -n \"\${LD_LIBRARY_PATH+set}\"; then
5809 export LD_LIBRARY_PATH=\$progdir:\$LD_LIBRARY_PATH
5813 # Backslashes separate directories on plain windows
5814 *-*-mingw | *-*-os2*)
5816 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5822 exec \"\$progdir/\$program\" \${1+\"\$@\"}
5827 \$echo \"\$0: cannot exec \$program \$*\"
5831 # The program doesn't exist.
5832 \
$echo \"\
$0: error
: \\\
`\$progdir/\$program' does not exist\" 1>&2
5833 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5834 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5845 # See if we need to build an old-fashioned archive.
5846 for oldlib in $oldlibs; do
5848 if test "$build_libtool_libs" = convenience; then
5849 oldobjs="$libobjs_save"
5850 addlibs="$convenience"
5851 build_libtool_libs=no
5853 if test "$build_libtool_libs" = module; then
5854 oldobjs="$libobjs_save"
5855 build_libtool_libs=no
5857 oldobjs="$old_deplibs $non_pic_objects"
5859 addlibs="$old_convenience"
5862 if test -n "$addlibs"; then
5863 gentop="$output_objdir/${outputname}x"
5864 generated="$generated $gentop"
5866 func_extract_archives $gentop $addlibs
5867 oldobjs="$oldobjs $func_extract_archives_result"
5870 # Do each command in the archive commands.
5871 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5872 cmds=$old_archive_from_new_cmds
5874 # POSIX demands no paths to be encoded in archives. We have
5875 # to avoid creating archives with duplicate basenames if we
5876 # might have to extract them afterwards, e.g., when creating a
5877 # static archive out of a convenience library, or when linking
5878 # the entirety of a libtool archive into another (currently
5879 # not supported by libtool).
5880 if (for obj in $oldobjs
5882 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5883 done | sort | sort -uc >/dev/null 2>&1); then
5886 $echo "copying selected object files to avoid basename conflicts..."
5888 if test -z "$gentop"; then
5889 gentop="$output_objdir/${outputname}x"
5890 generated="$generated $gentop"
5892 $show "${rm}r $gentop"
5893 $run ${rm}r "$gentop"
5894 $show "$mkdir $gentop"
5895 $run $mkdir "$gentop"
5897 if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
5902 save_oldobjs=$oldobjs
5905 for obj in $save_oldobjs
5907 objbase=`$echo "X$obj" |
$Xsed -e 's%^.*/%%'`
5908 case " $oldobjs " in
5909 " ") oldobjs=$obj ;;
5912 # Make sure we don't pick an alternate name that also
5914 newobj=lt$counter-$objbase
5915 counter=`expr $counter + 1`
5916 case " $oldobjs " in
5917 *[\ /]"$newobj "*) ;;
5918 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
5921 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5922 $run ln "$obj" "$gentop/$newobj" ||
5923 $run cp "$obj" "$gentop/$newobj"
5924 oldobjs="$oldobjs $gentop/$newobj"
5926 *) oldobjs="$oldobjs $obj" ;;
5931 eval cmds=\"$old_archive_cmds\"
5933 if len=`expr "X$cmds" : ".*"` &&
5934 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5935 cmds=$old_archive_cmds
5937 # the command line is too long to link in one step, link in parts
5938 $echo "using piecewise archive linking..."
5943 save_oldobjs=$oldobjs
5945 # Is there a better way of finding the last object in the list?
5946 for obj in $save_oldobjs
5950 for obj in $save_oldobjs
5952 oldobjs="$objlist $obj"
5953 objlist="$objlist $obj"
5954 eval test_cmds=\"$old_archive_cmds\"
5955 if len=`expr "X$test_cmds" : ".*" 2>/dev
/null
` &&
5956 test "$len" -le "$max_cmd_len"; then
5959 # the above command should be used before it gets too long
5961 if test "$obj" = "$last_oldobj" ; then
5964 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5965 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5971 if test "X$oldobjs" = "X" ; then
5972 eval cmds=\"\$concat_cmds\"
5974 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5978 save_ifs="$IFS"; IFS='~'
5979 for cmd in $cmds; do
5983 $run eval "$cmd" || exit $?
5988 if test -n "$generated"; then
5989 $show "${rm}r$generated"
5990 $run ${rm}r$generated
5993 # Now create the libtool archive.
5997 test "$build_old_libs" = yes && old_library="$libname.$libext"
5998 $show "creating $output"
6000 # Preserve any variables that may affect compiler behavior
6001 for var in $variables_saved_for_relink; do
6002 if eval test -z \"\${$var+set}\"; then
6003 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
6004 elif eval var_value=\$$var; test -z "$var_value"; then
6005 relink_command="$var=; export $var; $relink_command"
6007 var_value=`$echo "X$var_value" |
$Xsed -e "$sed_quote_subst"`
6008 relink_command="$var=\"$var_value\"; export $var; $relink_command"
6011 # Quote the link command for shipping.
6012 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
6013 relink_command=`$echo "X$relink_command" |
$SP2NL |
$Xsed -e "$sed_quote_subst" |
$NL2SP`
6014 if test "$hardcode_automatic" = yes ; then
6019 # Only create the output if not a dry run.
6020 if test -z "$run"; then
6021 for installed in no yes; do
6022 if test "$installed" = yes; then
6023 if test -z "$install_libdir"; then
6026 output="$output_objdir/$outputname"i
6027 # Replace all uninstalled libtool libraries with the installed ones
6029 for deplib in $dependency_libs; do
6032 name=`$echo "X$deplib" |
$Xsed -e 's%^.*/%%'`
6033 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
6034 if test -z "$libdir"; then
6035 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
6038 if test "X$EGREP" = X ; then
6041 # We do not want portage's
install root
($D) present. Check only
for
6042 # this if the .la is being installed.
6043 if test "$installed" = yes && test "$D"; then
6044 eval mynewdependency_lib
=`echo "$libdir/$name" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
6046 mynewdependency_lib
="$libdir/$name"
6048 # Do not add duplicates
6049 if test "$mynewdependency_lib"; then
6050 my_little_ninja_foo_1
=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"`
6051 if test -z "$my_little_ninja_foo_1"; then
6052 newdependency_libs
="$newdependency_libs $mynewdependency_lib"
6057 if test "$installed" = yes; then
6058 # Rather use S=WORKDIR if our version of portage supports it.
6059 # This is because some ebuild (gcc) do not use $S as buildroot.
6060 if test "$PWORKDIR"; then
6063 # We do not want portage's build root ($S) present.
6064 my_little_ninja_foo_2
=`echo $deplib |$EGREP -e "$S"`
6065 # We do not want portage's install root ($D) present.
6066 my_little_ninja_foo_3
=`echo $deplib |$EGREP -e "$D"`
6067 if test -n "$my_little_ninja_foo_2" && test "$S"; then
6068 mynewdependency_lib
=""
6069 elif test -n "$my_little_ninja_foo_3" && test "$D"; then
6070 eval mynewdependency_lib
=`echo "$deplib" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
6072 mynewdependency_lib
="$deplib"
6075 mynewdependency_lib
="$deplib"
6077 # Do not add duplicates
6078 if test "$mynewdependency_lib"; then
6079 my_little_ninja_foo_4
=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"`
6080 if test -z "$my_little_ninja_foo_4"; then
6081 newdependency_libs
="$newdependency_libs $mynewdependency_lib"
6087 dependency_libs
="$newdependency_libs"
6089 for lib
in $dlfiles; do
6090 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
6091 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
6092 if test -z "$libdir"; then
6093 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6096 newdlfiles
="$newdlfiles $libdir/$name"
6098 dlfiles
="$newdlfiles"
6100 for lib
in $dlprefiles; do
6101 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
6102 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
6103 if test -z "$libdir"; then
6104 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6107 newdlprefiles
="$newdlprefiles $libdir/$name"
6109 dlprefiles
="$newdlprefiles"
6112 for lib
in $dlfiles; do
6114 [\\/]* |
[A-Za-z
]:[\\/]*) abs
="$lib" ;;
6115 *) abs
=`pwd`"/$lib" ;;
6117 newdlfiles
="$newdlfiles $abs"
6119 dlfiles
="$newdlfiles"
6121 for lib
in $dlprefiles; do
6123 [\\/]* |
[A-Za-z
]:[\\/]*) abs
="$lib" ;;
6124 *) abs
=`pwd`"/$lib" ;;
6126 newdlprefiles
="$newdlprefiles $abs"
6128 dlprefiles
="$newdlprefiles"
6131 # place dlname in correct position for cygwin
6133 case $host,$output,$installed,$module,$dlname in
6134 *cygwin
*,*lai
,yes,no
,*.dll |
*mingw
*,*lai
,yes,no
,*.dll
) tdlname
=..
/bin
/$dlname ;;
6136 # Do not add duplicates
6137 if test "$installed" = yes && test "$D"; then
6138 install_libdir
=`echo "$install_libdir" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
6141 # $outputname - a libtool library file
6142 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
6144 # Please DO NOT delete this file!
6145 # It is necessary for linking the library.
6147 # The name that we can dlopen(3).
6150 # Names of this library.
6151 library_names='$library_names'
6153 # The name of the static archive.
6154 old_library='$old_library'
6156 # Libraries that this one depends upon.
6157 dependency_libs='$dependency_libs'
6159 # Version information for $libname.
6164 # Is this an already installed library?
6165 installed=$installed
6167 # Should we warn about portability when linking against -modules?
6168 shouldnotlink=$module
6170 # Files to dlopen/dlpreopen
6172 dlpreopen='$dlprefiles'
6174 # Directory that this library needs to be installed in:
6175 libdir='$install_libdir'"
6176 if test "$installed" = no
&& test "$need_relink" = yes; then
6178 relink_command=\"$relink_command\""
6183 # Do a symbolic link so that the libtool archive can be found in
6184 # LD_LIBRARY_PATH before the program is installed.
6185 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
6186 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' ||
exit $?
6192 # libtool install mode
6194 modename
="$modename: install"
6196 # There may be an optional sh(1) argument at the beginning of
6197 # install_prog (especially on Windows NT).
6198 if test "$nonopt" = "$SHELL" ||
test "$nonopt" = /bin
/sh ||
6199 # Allow the use of GNU shtool's install command.
6200 $echo "X$nonopt" |
grep shtool
> /dev
/null
; then
6201 # Aesthetically quote it.
6202 arg
=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
6204 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6208 install_prog
="$arg "
6216 # The real first argument should be the name of the installation program.
6217 # Aesthetically quote it.
6218 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
6220 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6224 install_prog
="$install_prog$arg"
6226 # We need to accept at least all the BSD install flags.
6236 if test -n "$dest"; then
6237 files
="$files $dest"
6245 case " $install_prog " in
6250 -g |
-m |
-o) prev
=$arg ;;
6258 # If the previous option needed an argument, then skip it.
6259 if test -n "$prev"; then
6268 # Aesthetically quote the argument.
6269 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
6271 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6275 install_prog
="$install_prog $arg"
6278 if test -z "$install_prog"; then
6279 $echo "$modename: you must specify an install program" 1>&2
6284 if test -n "$prev"; then
6285 $echo "$modename: the \`$prev' option requires an argument" 1>&2
6290 if test -z "$files"; then
6291 if test -z "$dest"; then
6292 $echo "$modename: no file or destination specified" 1>&2
6294 $echo "$modename: you must specify a destination" 1>&2
6300 # Strip any trailing slash from the destination.
6301 dest
=`$echo "X$dest" | $Xsed -e 's%/$%%'`
6303 # Check to see that the destination is a directory.
6304 test -d "$dest" && isdir
=yes
6305 if test "$isdir" = yes; then
6309 destdir
=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
6310 test "X$destdir" = "X$dest" && destdir
=.
6311 destname
=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
6313 # Not a directory, so check to see that there is only one file specified.
6315 if test "$#" -gt 2; then
6316 $echo "$modename: \`$dest' is not a directory" 1>&2
6322 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
6324 for file in $files; do
6328 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
6337 # This variable tells wrapper scripts just to set variables rather
6338 # than running their programs.
6339 libtool_install_magic
="$magic"
6344 for file in $files; do
6346 # Do each installation.
6349 # Do the static libraries later.
6350 staticlibs
="$staticlibs $file"
6354 # Check to see that this really is a libtool archive.
6355 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
6357 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
6365 # If there is no directory component, then add one.
6367 */* |
*\\*) .
$file ;;
6371 # Add the libdir to current_libdirs if it is the destination.
6372 if test "X$destdir" = "X$libdir"; then
6373 case "$current_libdirs " in
6375 *) current_libdirs
="$current_libdirs $libdir" ;;
6378 # Note the libdir as a future libdir.
6379 case "$future_libdirs " in
6381 *) future_libdirs
="$future_libdirs $libdir" ;;
6385 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
6386 test "X$dir" = "X$file/" && dir
=
6389 if test -n "$relink_command"; then
6390 # Determine the prefix the user has applied to our future dir.
6391 inst_prefix_dir
=`$echo "$destdir" | $SED "s%$libdir\$%%"`
6393 # Don't allow the user to place us outside of our expected
6394 # location b/c this prevents finding dependent libraries that
6395 # are installed to the same prefix.
6396 # At present, this check doesn't affect windows .dll's that
6397 # are installed into $libdir/../bin (currently, that works fine)
6398 # but it's something to keep an eye on.
6399 if test "$inst_prefix_dir" = "$destdir"; then
6400 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
6404 if test -n "$inst_prefix_dir"; then
6405 # Stick the inst_prefix_dir data into the link command.
6406 relink_command
=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
6408 relink_command
=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
6411 $echo "$modename: warning: relinking \`$file'" 1>&2
6412 $show "$relink_command"
6413 if $run eval "$relink_command"; then :
6415 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6420 # See the names of the shared library.
6421 set dummy
$library_names
6422 if test -n "$2"; then
6428 test -n "$relink_command" && srcname
="$realname"T
6430 # Install the shared library and build the symlinks.
6431 $show "$install_prog $dir/$srcname $destdir/$realname"
6432 $run eval "$install_prog $dir/$srcname $destdir/$realname" ||
exit $?
6433 if test -n "$stripme" && test -n "$striplib"; then
6434 $show "$striplib $destdir/$realname"
6435 $run eval "$striplib $destdir/$realname" ||
exit $?
6438 if test "$#" -gt 0; then
6439 # Delete the old symlinks, and create new ones.
6440 # Try `ln -sf' first, because the `ln' binary might depend on
6441 # the symlink we replace! Solaris /bin/ln does not understand -f,
6442 # so we also need to try rm && ln -s.
6445 if test "$linkname" != "$realname"; then
6446 $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6447 $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6452 # Do each command in the postinstall commands.
6453 lib
="$destdir/$realname"
6454 cmds
=$postinstall_cmds
6455 save_ifs
="$IFS"; IFS
='~'
6456 for cmd
in $cmds; do
6460 $run eval "$cmd" ||
{
6463 # Restore the uninstalled library and exit
6464 if test "$mode" = relink
; then
6465 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
6474 # Install the pseudo-library for information purposes.
6475 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6476 instname
="$dir/$name"i
6477 $show "$install_prog $instname $destdir/$name"
6478 $run eval "$install_prog $instname $destdir/$name" ||
exit $?
6480 # Maybe install the static library, too.
6481 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
6485 # Install (i.e. copy) a libtool object.
6487 # Figure out destination file name, if it wasn't already specified.
6488 if test -n "$destname"; then
6489 destfile
="$destdir/$destname"
6491 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6492 destfile
="$destdir/$destfile"
6495 # Deduce the name of the destination old-style object file.
6498 staticdest
=`$echo "X$destfile" | $Xsed -e "$lo2o"`
6501 staticdest
="$destfile"
6505 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
6511 # Install the libtool object if requested.
6512 if test -n "$destfile"; then
6513 $show "$install_prog $file $destfile"
6514 $run eval "$install_prog $file $destfile" ||
exit $?
6517 # Install the old object if enabled.
6518 if test "$build_old_libs" = yes; then
6519 # Deduce the name of the old-style object file.
6520 staticobj
=`$echo "X$file" | $Xsed -e "$lo2o"`
6522 $show "$install_prog $staticobj $staticdest"
6523 $run eval "$install_prog \$staticobj \$staticdest" ||
exit $?
6529 # Figure out destination file name, if it wasn't already specified.
6530 if test -n "$destname"; then
6531 destfile
="$destdir/$destname"
6533 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6534 destfile
="$destdir/$destfile"
6537 # If the file is missing, and there is a .exe on the end, strip it
6538 # because it is most likely a libtool script we actually want to
6543 if test ! -f "$file"; then
6544 file=`$echo $file|${SED} 's,.exe$,,'`
6550 # Do a test to see if this is really a libtool program.
6553 wrapper
=`$echo $file | ${SED} -e 's,.exe$,,'`
6559 if (${SED} -e '4q' $wrapper |
grep "^# Generated by .*$PACKAGE")>/dev
/null
2>&1; then
6563 # Note that it is not necessary on cygwin/mingw to append a dot to
6564 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6565 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6566 # `FILE.' does not work on cygwin managed mounts.
6568 # If there is no directory component, then add one.
6570 */* |
*\\*) .
${wrapper} ;;
6571 *) . .
/${wrapper} ;;
6574 # Check the variables that should have been set.
6575 if test -z "$notinst_deplibs"; then
6576 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
6581 for lib
in $notinst_deplibs; do
6582 # Check to see that each library is installed.
6584 if test -f "$lib"; then
6585 # If there is no directory component, then add one.
6587 */* |
*\\*) .
$lib ;;
6591 libfile
="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
6592 if test -n "$libdir" && test ! -f "$libfile"; then
6593 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
6599 # Note that it is not necessary on cygwin/mingw to append a dot to
6600 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6601 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6602 # `FILE.' does not work on cygwin managed mounts.
6604 # If there is no directory component, then add one.
6606 */* |
*\\*) .
${wrapper} ;;
6607 *) . .
/${wrapper} ;;
6611 if test "$fast_install" = no
&& test -n "$relink_command"; then
6612 if test "$finalize" = yes && test -z "$run"; then
6613 tmpdir
=`func_mktempdir`
6614 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6615 outputname
="$tmpdir/$file"
6616 # Replace the output file specification.
6617 relink_command
=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
6619 $show "$relink_command"
6620 if $run eval "$relink_command"; then :
6622 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6628 $echo "$modename: warning: cannot relink \`$file'" 1>&2
6631 # Install the binary that we compiled earlier.
6632 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
6636 # remove .exe since cygwin /usr/bin/install will append another
6638 case $install_prog,$host in
6639 */usr
/bin
/install*,*cygwin
*)
6640 case $file:$destfile in
6645 destfile
=$destfile.exe
6648 destfile
=`$echo $destfile | ${SED} -e 's,.exe$,,'`
6653 $show "$install_prog$stripme $file $destfile"
6654 $run eval "$install_prog\$stripme \$file \$destfile" ||
exit $?
6655 test -n "$outputname" && ${rm}r
"$tmpdir"
6660 for file in $staticlibs; do
6661 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6663 # Set up the ranlib parameters.
6664 oldlib
="$destdir/$name"
6666 $show "$install_prog $file $oldlib"
6667 $run eval "$install_prog \$file \$oldlib" ||
exit $?
6669 if test -n "$stripme" && test -n "$old_striplib"; then
6670 $show "$old_striplib $oldlib"
6671 $run eval "$old_striplib $oldlib" ||
exit $?
6674 # Do each command in the postinstall commands.
6675 cmds
=$old_postinstall_cmds
6676 save_ifs
="$IFS"; IFS
='~'
6677 for cmd
in $cmds; do
6681 $run eval "$cmd" ||
exit $?
6686 if test -n "$future_libdirs"; then
6687 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
6690 if test -n "$current_libdirs"; then
6691 # Maybe just do a dry run.
6692 test -n "$run" && current_libdirs
=" -n$current_libdirs"
6693 exec_cmd
='$SHELL $progpath $preserve_args --finish$current_libdirs'
6699 # libtool finish mode
6701 modename
="$modename: finish"
6705 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
6708 libdirs
="$libdirs $dir"
6711 for libdir
in $libdirs; do
6712 if test -n "$finish_cmds"; then
6713 # Do each command in the finish commands.
6715 save_ifs
="$IFS"; IFS
='~'
6716 for cmd
in $cmds; do
6720 $run eval "$cmd" || admincmds
="$admincmds
6725 if test -n "$finish_eval"; then
6726 # Do the single finish_eval.
6727 eval cmds
=\"$finish_eval\"
6728 $run eval "$cmds" || admincmds
="$admincmds
6734 # Exit here if they wanted silent mode.
6735 test "$show" = : && exit $EXIT_SUCCESS
6737 $echo "X----------------------------------------------------------------------" |
$Xsed
6738 $echo "Libraries have been installed in:"
6739 for libdir
in $libdirs; do
6743 $echo "If you ever happen to want to link against installed libraries"
6744 $echo "in a given directory, LIBDIR, you must either use libtool, and"
6745 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6746 $echo "flag during linking and do at least one of the following:"
6747 if test -n "$shlibpath_var"; then
6748 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6749 $echo " during execution"
6751 if test -n "$runpath_var"; then
6752 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
6753 $echo " during linking"
6755 if test -n "$hardcode_libdir_flag_spec"; then
6757 eval flag
=\"$hardcode_libdir_flag_spec\"
6759 $echo " - use the \`$flag' linker flag"
6761 if test -n "$admincmds"; then
6762 $echo " - have your system administrator run these commands:$admincmds"
6764 if test -f /etc
/ld.so.conf
; then
6765 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6768 $echo "See any operating system documentation about shared libraries for"
6769 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6770 $echo "X----------------------------------------------------------------------" |
$Xsed
6774 # libtool execute mode
6776 modename
="$modename: execute"
6778 # The first argument is the command name.
6780 if test -z "$cmd"; then
6781 $echo "$modename: you must specify a COMMAND" 1>&2
6786 # Handle -dlopen flags immediately.
6787 for file in $execute_dlfiles; do
6788 if test ! -f "$file"; then
6789 $echo "$modename: \`$file' is not a file" 1>&2
6797 # Check to see that this really is a libtool archive.
6798 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
6800 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6805 # Read the libtool library.
6809 # If there is no directory component, then add one.
6811 */* |
*\\*) .
$file ;;
6815 # Skip this library if it cannot be dlopened.
6816 if test -z "$dlname"; then
6817 # Warn if it was a shared library.
6818 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6822 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6823 test "X$dir" = "X$file" && dir
=.
6825 if test -f "$dir/$objdir/$dlname"; then
6828 if test ! -f "$dir/$dlname"; then
6829 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6836 # Just add the directory containing the .lo file.
6837 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6838 test "X$dir" = "X$file" && dir
=.
6842 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6847 # Get the absolute pathname.
6848 absdir
=`cd "$dir" && pwd`
6849 test -n "$absdir" && dir
="$absdir"
6851 # Now add the directory to shlibpath_var.
6852 if eval "test -z \"\$$shlibpath_var\""; then
6853 eval "$shlibpath_var=\"\$dir\""
6855 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6859 # This variable tells wrapper scripts just to set shlibpath_var
6860 # rather than running their programs.
6861 libtool_execute_magic
="$magic"
6863 # Check if any of the arguments is a wrapper script.
6870 # Do a test to see if this is really a libtool program.
6871 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6872 # If there is no directory component, then add one.
6874 */* |
*\\*) .
$file ;;
6878 # Transform arg to wrapped name.
6879 file="$progdir/$program"
6883 # Quote arguments (to preserve shell metacharacters).
6884 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6885 args
="$args \"$file\""
6888 if test -z "$run"; then
6889 if test -n "$shlibpath_var"; then
6890 # Export the shlibpath_var.
6891 eval "export $shlibpath_var"
6894 # Restore saved environment variables
6895 for lt_var
in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
6897 eval "if test \"\${save_$lt_var+set}\" = set; then
6898 $lt_var=\$save_$lt_var; export $lt_var
6904 # Now prepare to actually exec the command.
6905 exec_cmd
="\$cmd$args"
6907 # Display what would be done.
6908 if test -n "$shlibpath_var"; then
6909 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6910 $echo "export $shlibpath_var"
6917 # libtool clean and uninstall mode
6919 modename
="$modename: $mode"
6925 # This variable tells wrapper scripts just to set variables rather
6926 # than running their programs.
6927 libtool_install_magic
="$magic"
6932 -f) rm="$rm $arg"; rmforce
=yes ;;
6933 -*) rm="$rm $arg" ;;
6934 *) files
="$files $arg" ;;
6938 if test -z "$rm"; then
6939 $echo "$modename: you must specify an RM program" 1>&2
6946 origobjdir
="$objdir"
6947 for file in $files; do
6948 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6949 if test "X$dir" = "X$file"; then
6951 objdir
="$origobjdir"
6953 objdir
="$dir/$origobjdir"
6955 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6956 test "$mode" = uninstall
&& objdir
="$dir"
6958 # Remember objdir for removal later, being careful to avoid duplicates
6959 if test "$mode" = clean
; then
6962 *) rmdirs
="$rmdirs $objdir" ;;
6966 # Don't error if the file doesn't exist and rm -f was used.
6967 if (test -L "$file") >/dev
/null
2>&1 \
6968 ||
(test -h "$file") >/dev
/null
2>&1 \
6969 ||
test -f "$file"; then
6971 elif test -d "$file"; then
6974 elif test "$rmforce" = yes; then
6982 # Possibly a libtool archive, so verify it.
6983 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6986 # Delete the libtool libraries and symlinks.
6987 for n
in $library_names; do
6988 rmfiles
="$rmfiles $objdir/$n"
6990 test -n "$old_library" && rmfiles
="$rmfiles $objdir/$old_library"
6994 case " $library_names " in
6995 # " " in the beginning catches empty $dlname
6997 *) rmfiles
="$rmfiles $objdir/$dlname" ;;
6999 test -n "$libdir" && rmfiles
="$rmfiles $objdir/$name $objdir/${name}i"
7002 if test -n "$library_names"; then
7003 # Do each command in the postuninstall commands.
7004 cmds
=$postuninstall_cmds
7005 save_ifs
="$IFS"; IFS
='~'
7006 for cmd
in $cmds; do
7011 if test "$?" -ne 0 && test "$rmforce" != yes; then
7018 if test -n "$old_library"; then
7019 # Do each command in the old_postuninstall commands.
7020 cmds
=$old_postuninstall_cmds
7021 save_ifs
="$IFS"; IFS
='~'
7022 for cmd
in $cmds; do
7027 if test "$?" -ne 0 && test "$rmforce" != yes; then
7033 # FIXME: should reinstall the best remaining shared library.
7040 # Possibly a libtool object, so verify it.
7041 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
7046 # Add PIC object to the list of files to remove.
7047 if test -n "$pic_object" \
7048 && test "$pic_object" != none
; then
7049 rmfiles
="$rmfiles $dir/$pic_object"
7052 # Add non-PIC object to the list of files to remove.
7053 if test -n "$non_pic_object" \
7054 && test "$non_pic_object" != none
; then
7055 rmfiles
="$rmfiles $dir/$non_pic_object"
7061 if test "$mode" = clean
; then
7065 file=`$echo $file|${SED} 's,.exe$,,'`
7066 noexename
=`$echo $name|${SED} 's,.exe$,,'`
7067 # $file with .exe has already been added to rmfiles,
7068 # add $file without .exe
7069 rmfiles
="$rmfiles $file"
7072 # Do a test to see if this is a libtool program.
7073 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
7077 # note $name still contains .exe if it was in $file originally
7078 # as does the version of $file that was added into $rmfiles
7079 rmfiles
="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
7080 if test "$fast_install" = yes && test -n "$relink_command"; then
7081 rmfiles
="$rmfiles $objdir/lt-$name"
7083 if test "X$noexename" != "X$name" ; then
7084 rmfiles
="$rmfiles $objdir/lt-${noexename}.c"
7090 $show "$rm $rmfiles"
7091 $run $rm $rmfiles || exit_status
=1
7093 objdir
="$origobjdir"
7095 # Try to remove the ${objdir}s in the directories where we deleted files
7096 for dir
in $rmdirs; do
7097 if test -d "$dir"; then
7099 $run rmdir $dir >/dev
/null
2>&1
7107 $echo "$modename: you must specify a MODE" 1>&2
7108 $echo "$generic_help" 1>&2
7113 if test -z "$exec_cmd"; then
7114 $echo "$modename: invalid operation mode \`$mode'" 1>&2
7115 $echo "$generic_help" 1>&2
7118 fi # test -z "$show_help"
7120 if test -n "$exec_cmd"; then
7125 # We need to display help for each of the modes.
7128 "Usage: $modename [OPTION]... [MODE-ARG]...
7130 Provide generalized library-building support services.
7132 --config show all configuration variables
7133 --debug enable verbose shell tracing
7134 -n, --dry-run display commands without modifying any files
7135 --features display basic configuration information and exit
7136 --finish same as \`--mode=finish'
7137 --help display this help message and exit
7138 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
7139 --quiet same as \`--silent'
7140 --silent don't print informational messages
7141 --tag=TAG use configuration variables from tag TAG
7142 --version print version information
7144 MODE must be one of the following:
7146 clean remove files from the build directory
7147 compile compile a source file into a libtool object
7148 execute automatically set library path, then run a program
7149 finish complete the installation of libtool libraries
7150 install install libraries or executables
7151 link create a library or an executable
7152 uninstall remove libraries from an installed directory
7154 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
7155 a more detailed description of MODE.
7157 Report bugs to <bug-libtool@gnu.org>."
7163 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
7165 Remove files from the build directory.
7167 RM is the name of the program to use to delete files associated with each FILE
7168 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
7171 If FILE is a libtool library, object or program, all the files associated
7172 with it are deleted. Otherwise, only FILE itself is deleted using RM."
7177 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
7179 Compile a source file into a libtool library object.
7181 This mode accepts the following additional options:
7183 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
7184 -prefer-pic try to building PIC objects only
7185 -prefer-non-pic try to building non-PIC objects only
7186 -static always build a \`.o' file suitable for static linking
7188 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
7189 from the given SOURCEFILE.
7191 The output file name is determined by removing the directory component from
7192 SOURCEFILE, then substituting the C source code suffix \`.c' with the
7193 library object suffix, \`.lo'."
7198 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
7200 Automatically set library path, then run a program.
7202 This mode accepts the following additional options:
7204 -dlopen FILE add the directory containing FILE to the library path
7206 This mode sets the library path environment variable according to \`-dlopen'
7209 If any of the ARGS are libtool executable wrappers, then they are translated
7210 into their corresponding uninstalled binary, and any of their required library
7211 directories are added to the library path.
7213 Then, COMMAND is executed, with ARGS as arguments."
7218 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
7220 Complete the installation of libtool libraries.
7222 Each LIBDIR is a directory that contains libtool libraries.
7224 The commands that this mode executes may require superuser privileges. Use
7225 the \`--dry-run' option if you just want to see what would be executed."
7230 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
7232 Install executables or libraries.
7234 INSTALL-COMMAND is the installation command. The first component should be
7235 either the \`install' or \`cp' program.
7237 The rest of the components are interpreted as arguments to that command (only
7238 BSD-compatible install options are recognized)."
7243 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
7245 Link object files or libraries together to form another library, or to
7246 create an executable program.
7248 LINK-COMMAND is a command using the C compiler that you would use to create
7249 a program from several object files.
7251 The following components of LINK-COMMAND are treated specially:
7253 -all-static do not do any dynamic linking at all
7254 -avoid-version do not add a version suffix if possible
7255 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
7256 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
7257 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
7258 -export-symbols SYMFILE
7259 try to export only the symbols listed in SYMFILE
7260 -export-symbols-regex REGEX
7261 try to export only the symbols matching REGEX
7262 -LLIBDIR search LIBDIR for required installed libraries
7263 -lNAME OUTPUT-FILE requires the installed library libNAME
7264 -module build a library that can dlopened
7265 -no-fast-install disable the fast-install mode
7266 -no-install link a not-installable executable
7267 -no-undefined declare that a library does not refer to external symbols
7268 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
7269 -objectlist FILE Use a list of object files found in FILE to specify objects
7270 -precious-files-regex REGEX
7271 don't remove output files matching REGEX
7272 -release RELEASE specify package release information
7273 -rpath LIBDIR the created library will eventually be installed in LIBDIR
7274 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
7275 -static do not do any dynamic linking of uninstalled libtool libraries
7276 -static-libtool-libs
7277 do not do any dynamic linking of libtool libraries
7278 -version-info CURRENT[:REVISION[:AGE]]
7279 specify library version info [each variable defaults to 0]
7281 All other options (arguments beginning with \`-') are ignored.
7283 Every other argument is treated as a filename. Files ending in \`.la' are
7284 treated as uninstalled libtool libraries, other files are standard or library
7287 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
7288 only library objects (\`.lo' files) may be specified, and \`-rpath' is
7289 required, except when creating a convenience library.
7291 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
7292 using \`ar' and \`ranlib', or on Windows using \`lib'.
7294 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
7295 is created, otherwise an executable program is created."
7300 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
7302 Remove libraries from an installation directory.
7304 RM is the name of the program to use to delete files associated with each FILE
7305 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
7308 If FILE is a libtool library, all the files associated with it are deleted.
7309 Otherwise, only FILE itself is deleted using RM."
7313 $echo "$modename: invalid operation mode \`$mode'" 1>&2
7320 $echo "Try \`$modename --help' for more information about other modes."
7324 # The TAGs below are defined such that we never get into a situation
7325 # in which we disable both kinds of libraries. Given conflicting
7326 # choices, we go for a static library, that is the most portable,
7327 # since we can't tell whether shared libraries were disabled because
7328 # the user asked for that or because the platform doesn't support
7329 # them. This is particularly important on AIX, because we don't
7330 # support having both static and shared libraries enabled at the same
7331 # time on that platform, so we default to a shared-only configuration.
7332 # If a disable-shared tag is given, we'll fallback to a static-only
7333 # configuration. But we'll never go from static-only to shared-only.
7335 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
7337 # ### END LIBTOOL TAG CONFIG: disable-shared
7339 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
7341 # ### END LIBTOOL TAG CONFIG: disable-static
7347 # ### BEGIN LIBTOOL TAG CONFIG: CXX
7349 # Libtool was configured on host ubuntu:
7351 # Shell to use when invoking shell scripts.
7354 # Whether or not to build shared libraries.
7355 build_libtool_libs
=yes
7357 # Whether or not to build static libraries.
7360 # Whether or not to add -lc for building shared libraries.
7361 build_libtool_need_lc
=no
7363 # Whether or not to disallow shared libs when runtime libs are static
7364 allow_libtool_libs_with_static_runtimes
=no
7366 # Whether or not to optimize for fast installation.
7371 host=i686-pc-linux-gnu
7376 build
=i686-pc-linux-gnu
7379 # An echo program that does not interpret backslashes.
7389 # LTCC compiler flags.
7392 # A language-specific compiler.
7395 # Is the compiler the GNU C compiler?
7399 EGREP
="/bin/grep -E"
7401 # The linker used to build libraries.
7404 # Whether we need hard or soft links.
7407 # A BSD-compatible nm program.
7410 # A symbol stripping program
7413 # Used to examine libraries when file_magic_cmd begins "file"
7416 # Used on cygwin: DLL creation program.
7419 # Used on cygwin: object dumper.
7422 # Used on cygwin: assembler.
7425 # The name of the directory that contains temporary libtool files.
7428 # How to create reloadable object files.
7430 reload_cmds
="\$LD\$reload_flag -o \$output\$reload_objs"
7432 # How to pass a linker flag through the compiler.
7435 # Object file suffix (normally "o").
7438 # Old archive suffix (normally "a").
7441 # Shared library suffix (normally ".so").
7444 # Executable file suffix (normally "").
7447 # Additional compiler flags for building library objects.
7448 pic_flag
=" -fPIC -DPIC"
7451 # What is the maximum length of a command?
7454 # Does compiler simultaneously support -c and -o options?
7457 # Must we lock files when doing compilation?
7460 # Do we need the lib prefix for modules?
7463 # Do we need a version for libraries?
7466 # Whether dlopen is supported.
7467 dlopen_support
=unknown
7469 # Whether dlopen of programs is supported.
7472 # Whether dlopen of statically linked programs is supported.
7473 dlopen_self_static
=unknown
7475 # Compiler flag to prevent dynamic linking.
7476 link_static_flag
="-static"
7478 # Compiler flag to turn off builtin functions.
7479 no_builtin_flag
=" -fno-builtin"
7481 # Compiler flag to allow reflexive dlopens.
7482 export_dynamic_flag_spec
="\${wl}--export-dynamic"
7484 # Compiler flag to generate shared objects directly from archives.
7485 whole_archive_flag_spec
="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
7487 # Compiler flag to generate thread-safe objects.
7488 thread_safe_flag_spec
=""
7490 # Library versioning type.
7493 # Format of library name prefix.
7494 libname_spec
="lib\$name"
7496 # List of archive names. First name is the real one, the rest are links.
7497 # The last name is the one that the linker finds with -lNAME.
7498 library_names_spec
="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
7500 # The coded name of the library, if different from the real name.
7501 soname_spec
="\${libname}\${release}\${shared_ext}\$major"
7503 # Commands used to build and install an old-style archive.
7505 old_archive_cmds
="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
7506 old_postinstall_cmds
="chmod 644 \$oldlib~\$RANLIB \$oldlib"
7507 old_postuninstall_cmds
=""
7509 # Create an old-style archive from a shared archive.
7510 old_archive_from_new_cmds
=""
7512 # Create a temporary old-style archive to link instead of a shared archive.
7513 old_archive_from_expsyms_cmds
=""
7515 # Commands used to build and install a shared archive.
7516 archive_cmds
="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
7517 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"
7519 postuninstall_cmds
=""
7521 # Commands used to build a loadable module (assumed same as above if empty)
7523 module_expsym_cmds
=""
7525 # Commands to strip libraries.
7526 old_striplib
="strip --strip-debug"
7527 striplib
="strip --strip-unneeded"
7529 # Dependencies to place before the objects being linked to create a
7531 predep_objects
="/usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../lib/crti.o /usr/lib/gcc/i486-linux-gnu/4.4.3/crtbeginS.o"
7533 # Dependencies to place after the objects being linked to create a
7535 postdep_objects
="/usr/lib/gcc/i486-linux-gnu/4.4.3/crtendS.o /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../lib/crtn.o"
7537 # Dependencies to place before the objects being linked to create a
7541 # Dependencies to place after the objects being linked to create a
7543 postdeps
="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
7545 # The library search path used internally by the compiler when linking
7547 compiler_lib_search_path
="-L/usr/lib/gcc/i486-linux-gnu/4.4.3 -L/usr/lib/gcc/i486-linux-gnu/4.4.3 -L/usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/i486-linux-gnu/4.4.3/../../.. -L/usr/lib/i486-linux-gnu"
7549 # Method to check whether dependent libraries are shared objects.
7550 deplibs_check_method
="pass_all"
7552 # Command to use when deplibs_check_method == file_magic.
7553 file_magic_cmd
="\$MAGIC_CMD"
7555 # Flag that allows shared libraries with undefined symbols to be built.
7556 allow_undefined_flag
=""
7558 # Flag that forces no undefined symbols.
7559 no_undefined_flag
=""
7561 # Commands used to finish a libtool library installation in a directory.
7562 finish_cmds
="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
7564 # Same as above, but a single script fragment to be evaled but not shown.
7567 # Take the output of nm and produce a listing of raw symbols and C names.
7568 global_symbol_pipe
="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
7570 # Transform the output of nm in a proper C declaration
7571 global_symbol_to_cdecl
="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
7573 # Transform the output of nm in a C name address pair
7574 global_symbol_to_c_name_address
="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
7576 # This is the shared library runtime path variable.
7577 runpath_var
=LD_RUN_PATH
7579 # This is the shared library path variable.
7580 shlibpath_var
=LD_LIBRARY_PATH
7582 # Is shlibpath searched before the hard-coded library search path?
7583 shlibpath_overrides_runpath
=no
7585 # How to hardcode a shared library path into an executable.
7586 hardcode_action
=immediate
7588 # Whether we should hardcode library paths into libraries.
7589 hardcode_into_libs
=yes
7591 # Flag to hardcode $libdir into a binary during linking.
7592 # This must work even if $libdir does not exist.
7593 hardcode_libdir_flag_spec
="\${wl}--rpath \${wl}\$libdir"
7595 # If ld is used when linking, flag to hardcode $libdir into
7596 # a binary during linking. This must work even if $libdir does
7598 hardcode_libdir_flag_spec_ld
=""
7600 # Whether we need a single -rpath flag with a separated argument.
7601 hardcode_libdir_separator
=""
7603 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
7607 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
7611 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
7612 # the resulting binary.
7613 hardcode_shlibpath_var
=unsupported
7615 # Set to yes if building a shared library automatically hardcodes DIR into the library
7616 # and all subsequent libraries and executables linked against it.
7617 hardcode_automatic
=no
7619 # Variables whose values should be saved in libtool wrapper scripts and
7620 # restored at relink time.
7621 variables_saved_for_relink
="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
7623 # Whether libtool must link a program against all its dependency libraries.
7624 link_all_deplibs
=unknown
7626 # Compile-time system search path for libraries
7627 sys_lib_search_path_spec
="/usr/lib/gcc/i486-linux-gnu/4.4.3 /usr/lib /lib /usr/lib/i486-linux-gnu"
7629 # Run-time system search path for libraries
7630 sys_lib_dlsearch_path_spec
="/lib /usr/lib /usr/lib/nvidia-current /lib/i486-linux-gnu /usr/lib/i486-linux-gnu /usr/lib/alsa-lib /usr/local/lib "
7632 # Fix the shell variable $srcfile for the compiler.
7635 # Set to yes if exported symbols are required.
7636 always_export_symbols
=no
7638 # The commands to list exported symbols.
7639 export_symbols_cmds
="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
7641 # The commands to extract the exported symbol list from a shared archive.
7642 extract_expsyms_cmds
=""
7644 # Symbols that should not be listed in the preloaded symbols.
7647 # Symbols that must always be exported.
7650 # ### END LIBTOOL TAG CONFIG: CXX