subversion/release.sh: avoid copying Makefile if not necessary
[msysgit.git] / bin / libtool
blobb8944e097d01f4d421fafc6b58242cd936e473d9
1 #! /bin/sh
3 # libtoolT - Provide generalized library-building support services.
4 # Generated automatically by (GNU libtool 1.5.24)
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.
33 SED="/bin/sed"
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
39 # if CDPATH is set.
40 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
42 # The names of the tagged configurations supported by this script.
43 available_tags=" CXX F77"
45 # ### BEGIN LIBTOOL CONFIG
47 # Libtool was configured on host D293LXD1:
49 # Shell to use when invoking shell scripts.
50 SHELL="/bin/sh"
52 # Whether or not to build shared libraries.
53 build_libtool_libs=yes
55 # Whether or not to build static libraries.
56 build_old_libs=yes
58 # Whether or not to add -lc for building shared libraries.
59 build_libtool_need_lc=yes
61 # Whether or not to disallow shared libs when runtime libs are static
62 allow_libtool_libs_with_static_runtimes=yes
64 # Whether or not to optimize for fast installation.
65 fast_install=needless
67 # The host system.
68 host_alias=
69 host=i686-pc-mingw32
70 host_os=mingw32
72 # The build system.
73 build_alias=i686-pc-mingw32
74 build=i686-pc-mingw32
75 build_os=mingw32
77 # An echo program that does not interpret backslashes.
78 echo="echo"
80 # The archiver.
81 AR="ar"
82 AR_FLAGS="cru"
84 # A C compiler.
85 LTCC="gcc"
87 # LTCC compiler flags.
88 LTCFLAGS="-g -O2"
90 # A language-specific compiler.
91 CC="gcc"
93 # Is the compiler the GNU C compiler?
94 with_gcc=yes
96 # An ERE matcher.
97 EGREP="/bin/grep -E"
99 # The linker used to build libraries.
100 LD="/i686-pc-msys/bin/ld.exe"
102 # Whether we need hard or soft links.
103 LN_S="cp -p"
105 # A BSD-compatible nm program.
106 NM="/bin/nm -B"
108 # A symbol stripping program
109 STRIP="strip"
111 # Used to examine libraries when file_magic_cmd begins "file"
112 MAGIC_CMD=file
114 # Used on cygwin: DLL creation program.
115 DLLTOOL="dlltool"
117 # Used on cygwin: object dumper.
118 OBJDUMP="objdump"
120 # Used on cygwin: assembler.
121 AS="as"
123 # The name of the directory that contains temporary libtool files.
124 objdir=.libs
126 # How to create reloadable object files.
127 reload_flag=" -r"
128 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
130 # How to pass a linker flag through the compiler.
131 wl="-Wl,"
133 # Object file suffix (normally "o").
134 objext="o"
136 # Old archive suffix (normally "a").
137 libext="a"
139 # Shared library suffix (normally ".so").
140 shrext_cmds='.dll'
142 # Executable file suffix (normally "").
143 exeext=""
145 # Additional compiler flags for building library objects.
146 pic_flag=" -DDLL_EXPORT -DPIC"
147 pic_mode=default
149 # What is the maximum length of a command?
150 max_cmd_len=8192
152 # Does compiler simultaneously support -c and -o options?
153 compiler_c_o="yes"
155 # Must we lock files when doing compilation?
156 need_locks="no"
158 # Do we need the lib prefix for modules?
159 need_lib_prefix=no
161 # Do we need a version for libraries?
162 need_version=no
164 # Whether dlopen is supported.
165 dlopen_support=yes
167 # Whether dlopen of programs is supported.
168 dlopen_self=unknown
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=""
176 # Compiler flag to turn off builtin functions.
177 no_builtin_flag=" -fno-builtin -fno-rtti -fno-exceptions"
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.
189 version_type=windows
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.dll.a"
198 # The coded name of the library, if different from the real name.
199 soname_spec="\${libname}\`echo \${release} | \$SED -e s/[.]/-/g\`\${versuffix}\${shared_ext}"
201 # Commands used to build and install an old-style archive.
202 RANLIB="ranlib"
203 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
204 old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
205 old_postuninstall_cmds=""
207 # Create an old-style archive from a shared archive.
208 old_archive_from_new_cmds=""
210 # Create a temporary old-style archive to link instead of a shared archive.
211 old_archive_from_expsyms_cmds=""
213 # Commands used to build and install a shared archive.
214 archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib"
215 archive_expsym_cmds="if test \\\"x\\\`\$SED 1q \$export_symbols\\\`\\\" = xEXPORTS; then
216 cp \$export_symbols \$output_objdir/\$soname.def;
217 else
218 echo EXPORTS > \$output_objdir/\$soname.def;
219 cat \$export_symbols >> \$output_objdir/\$soname.def;
221 \$CC -shared \$output_objdir/\$soname.def \$libobjs \$deplibs \$compiler_flags -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib"
222 postinstall_cmds="base_file=\\\`basename \\\${file}\\\`~
223 dlpath=\\\`\$SHELL 2>&1 -c '. \$dir/'\\\${base_file}'i;echo \\\$dlname'\\\`~
224 dldir=\$destdir/\\\`dirname \\\$dlpath\\\`~
225 test -d \\\$dldir || mkdir -p \\\$dldir~
226 \$install_prog \$dir/\$dlname \\\$dldir/\$dlname~
227 chmod a+x \\\$dldir/\$dlname"
228 postuninstall_cmds="dldll=\\\`\$SHELL 2>&1 -c '. \$file; echo \\\$dlname'\\\`~
229 dlpath=\$dir/\\\$dldll~
230 \$rm \\\$dlpath"
232 # Commands used to build a loadable module (assumed same as above if empty)
233 module_cmds=""
234 module_expsym_cmds=""
236 # Commands to strip libraries.
237 old_striplib="strip --strip-debug"
238 striplib="strip --strip-unneeded"
240 # Dependencies to place before the objects being linked to create a
241 # shared library.
242 predep_objects=""
244 # Dependencies to place after the objects being linked to create a
245 # shared library.
246 postdep_objects=""
248 # Dependencies to place before the objects being linked to create a
249 # shared library.
250 predeps=""
252 # Dependencies to place after the objects being linked to create a
253 # shared library.
254 postdeps=""
256 # The library search path used internally by the compiler when linking
257 # a shared library.
258 compiler_lib_search_path=""
260 # Method to check whether dependent libraries are shared objects.
261 deplibs_check_method="file_magic file format pei*-i386(.*architecture: i386)?"
263 # Command to use when deplibs_check_method == file_magic.
264 file_magic_cmd="\$OBJDUMP -f"
266 # Flag that allows shared libraries with undefined symbols to be built.
267 allow_undefined_flag="unsupported"
269 # Flag that forces no undefined symbols.
270 no_undefined_flag=""
272 # Commands used to finish a libtool library installation in a directory.
273 finish_cmds=""
275 # Same as above, but a single script fragment to be evaled but not shown.
276 finish_eval=""
278 # Take the output of nm and produce a listing of raw symbols and C names.
279 global_symbol_pipe=""
281 # Transform the output of nm in a proper C declaration
282 global_symbol_to_cdecl=""
284 # Transform the output of nm in a C name address pair
285 global_symbol_to_c_name_address=""
287 # This is the shared library runtime path variable.
288 runpath_var=LD_RUN_PATH
290 # This is the shared library path variable.
291 shlibpath_var=PATH
293 # Is shlibpath searched before the hard-coded library search path?
294 shlibpath_overrides_runpath=yes
296 # How to hardcode a shared library path into an executable.
297 hardcode_action=immediate
299 # Whether we should hardcode library paths into libraries.
300 hardcode_into_libs=no
302 # Flag to hardcode $libdir into a binary during linking.
303 # This must work even if $libdir does not exist.
304 hardcode_libdir_flag_spec="-L\$libdir"
306 # If ld is used when linking, flag to hardcode $libdir into
307 # a binary during linking. This must work even if $libdir does
308 # not exist.
309 hardcode_libdir_flag_spec_ld=""
311 # Whether we need a single -rpath flag with a separated argument.
312 hardcode_libdir_separator=""
314 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
315 # resulting binary.
316 hardcode_direct=no
318 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
319 # resulting binary.
320 hardcode_minus_L=no
322 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
323 # the resulting binary.
324 hardcode_shlibpath_var=unsupported
326 # Set to yes if building a shared library automatically hardcodes DIR into the library
327 # and all subsequent libraries and executables linked against it.
328 hardcode_automatic=no
330 # Variables whose values should be saved in libtool wrapper scripts and
331 # restored at relink time.
332 variables_saved_for_relink="PATH PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
334 # Whether libtool must link a program against all its dependency libraries.
335 link_all_deplibs=unknown
337 # Compile-time system search path for libraries
338 sys_lib_search_path_spec=" /bin/../lib/gcc-lib/i686-pc-msys/2.95.3-1/ /bin/../lib/gcc-lib/ /usr/lib/gcc-lib/i686-pc-msys/2.95.3-1/ /usr/lib/gcc/i686-pc-msys/2.95.3-1/ /bin/../lib/gcc-lib/i686-pc-msys/2.95.3-1/../../../../i686-pc-msys/lib/i686-pc-msys/2.95.3-1/ /bin/../lib/gcc-lib/i686-pc-msys/2.95.3-1/../../../../i686-pc-msys/lib/ /usr/lib/gcc-lib/i686-pc-msys/2.95.3-1/../../../../i686-pc-msys/lib/i686-pc-msys/2.95.3-1/ /usr/lib/gcc-lib/i686-pc-msys/2.95.3-1/../../../../i686-pc-msys/lib/"
340 # Run-time system search path for libraries
341 sys_lib_dlsearch_path_spec="/lib /usr/lib"
343 # Fix the shell variable $srcfile for the compiler.
344 fix_srcfile_path=""
346 # Set to yes if exported symbols are required.
347 always_export_symbols=no
349 # The commands to list exported symbols.
350 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED -e '/^[BCDGRS][ ]/s/.*[ ]\\\\([^ ]*\\\\)/\\\\1 DATA/' -e '/^[AITW][ ]/s/.*[ ]//' | sort | uniq > \$export_symbols"
352 # The commands to extract the exported symbol list from a shared archive.
353 extract_expsyms_cmds=""
355 # Symbols that should not be listed in the preloaded symbols.
356 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
358 # Symbols that must always be exported.
359 include_expsyms=""
361 # ### END LIBTOOL CONFIG
363 # ltmain.sh - Provide generalized library-building support services.
364 # NOTE: Changing this file will not affect anything until you rerun configure.
366 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
367 # 2007 Free Software Foundation, Inc.
368 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
370 # This program is free software; you can redistribute it and/or modify
371 # it under the terms of the GNU General Public License as published by
372 # the Free Software Foundation; either version 2 of the License, or
373 # (at your option) any later version.
375 # This program is distributed in the hope that it will be useful, but
376 # WITHOUT ANY WARRANTY; without even the implied warranty of
377 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
378 # General Public License for more details.
380 # You should have received a copy of the GNU General Public License
381 # along with this program; if not, write to the Free Software
382 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
384 # As a special exception to the GNU General Public License, if you
385 # distribute this file as part of a program that contains a
386 # configuration script generated by Autoconf, you may include it under
387 # the same distribution terms that you use for the rest of that program.
389 basename="s,^.*/,,g"
391 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
392 # is ksh but when the shell is invoked as "sh" and the current value of
393 # the _XPG environment variable is not equal to 1 (one), the special
394 # positional parameter $0, within a function call, is the name of the
395 # function.
396 progpath="$0"
398 # The name of this program:
399 progname=`echo "$progpath" | $SED $basename`
400 modename="$progname"
402 # Global variables:
403 EXIT_SUCCESS=0
404 EXIT_FAILURE=1
406 PROGRAM=ltmain.sh
407 PACKAGE=libtool
408 VERSION=1.5.24
409 TIMESTAMP=" (1.1220.2.455 2007/06/24 02:13:29)"
411 # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
412 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
413 emulate sh
414 NULLCMD=:
415 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
416 # is contrary to our usage. Disable this feature.
417 alias -g '${1+"$@"}'='"$@"'
418 setopt NO_GLOB_SUBST
419 else
420 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
422 BIN_SH=xpg4; export BIN_SH # for Tru64
423 DUALCASE=1; export DUALCASE # for MKS sh
425 # Check that we have a working $echo.
426 if test "X$1" = X--no-reexec; then
427 # Discard the --no-reexec flag, and continue.
428 shift
429 elif test "X$1" = X--fallback-echo; then
430 # Avoid inline document here, it may be left over
432 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
433 # Yippee, $echo works!
435 else
436 # Restart under the correct shell, and then maybe $echo will work.
437 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
440 if test "X$1" = X--fallback-echo; then
441 # used as fallback echo
442 shift
443 cat <<EOF
446 exit $EXIT_SUCCESS
449 default_mode=
450 help="Try \`$progname --help' for more information."
451 magic="%%%MAGIC variable%%%"
452 mkdir="mkdir"
453 mv="mv -f"
454 rm="rm -f"
456 # Sed substitution that helps us do robust quoting. It backslashifies
457 # metacharacters that are still active within double-quoted strings.
458 Xsed="${SED}"' -e 1s/^X//'
459 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
460 # test EBCDIC or ASCII
461 case `echo X|tr X '\101'` in
462 A) # ASCII based system
463 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
464 SP2NL='tr \040 \012'
465 NL2SP='tr \015\012 \040\040'
467 *) # EBCDIC based system
468 SP2NL='tr \100 \n'
469 NL2SP='tr \r\n \100\100'
471 esac
473 # NLS nuisances.
474 # Only set LANG and LC_ALL to C if already set.
475 # These must not be set unconditionally because not all systems understand
476 # e.g. LANG=C (notably SCO).
477 # We save the old values to restore during execute mode.
478 for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
480 eval "if test \"\${$lt_var+set}\" = set; then
481 save_$lt_var=\$$lt_var
482 $lt_var=C
483 export $lt_var
485 done
487 # Make sure IFS has a sensible default
488 lt_nl='
490 IFS=" $lt_nl"
492 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
493 $echo "$modename: not configured to build any kind of library" 1>&2
494 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
495 exit $EXIT_FAILURE
498 # Global variables.
499 mode=$default_mode
500 nonopt=
501 prev=
502 prevopt=
503 run=
504 show="$echo"
505 show_help=
506 execute_dlfiles=
507 duplicate_deps=no
508 preserve_args=
509 lo2o="s/\\.lo\$/.${objext}/"
510 o2lo="s/\\.${objext}\$/.lo/"
511 extracted_archives=
512 extracted_serial=0
514 #####################################
515 # Shell function definitions:
516 # This seems to be the best place for them
518 # func_mktempdir [string]
519 # Make a temporary directory that won't clash with other running
520 # libtool processes, and avoids race conditions if possible. If
521 # given, STRING is the basename for that directory.
522 func_mktempdir ()
524 my_template="${TMPDIR-/tmp}/${1-$progname}"
526 if test "$run" = ":"; then
527 # Return a directory name, but don't create it in dry-run mode
528 my_tmpdir="${my_template}-$$"
529 else
531 # If mktemp works, use that first and foremost
532 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
534 if test ! -d "$my_tmpdir"; then
535 # Failing that, at least try and use $RANDOM to avoid a race
536 my_tmpdir="${my_template}-${RANDOM-0}$$"
538 save_mktempdir_umask=`umask`
539 umask 0077
540 $mkdir "$my_tmpdir"
541 umask $save_mktempdir_umask
544 # If we're not in dry-run mode, bomb out on failure
545 test -d "$my_tmpdir" || {
546 $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
547 exit $EXIT_FAILURE
551 $echo "X$my_tmpdir" | $Xsed
555 # func_win32_libid arg
556 # return the library type of file 'arg'
558 # Need a lot of goo to handle *both* DLLs and import libs
559 # Has to be a shell function in order to 'eat' the argument
560 # that is supplied when $file_magic_command is called.
561 func_win32_libid ()
563 win32_libid_type="unknown"
564 win32_fileres=`file -L $1 2>/dev/null`
565 case $win32_fileres in
566 *ar\ archive\ import\ library*) # definitely import
567 win32_libid_type="x86 archive import"
569 *ar\ archive*) # could be an import, or static
570 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
571 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
572 win32_nmres=`eval $NM -f posix -A $1 | \
573 $SED -n -e '1,100{
574 / I /{
575 s,.*,import,
580 case $win32_nmres in
581 import*) win32_libid_type="x86 archive import";;
582 *) win32_libid_type="x86 archive static";;
583 esac
586 *DLL*)
587 win32_libid_type="x86 DLL"
589 *executable*) # but shell scripts are "executable" too...
590 case $win32_fileres in
591 *MS\ Windows\ PE\ Intel*)
592 win32_libid_type="x86 DLL"
594 esac
596 esac
597 $echo $win32_libid_type
601 # func_infer_tag arg
602 # Infer tagged configuration to use if any are available and
603 # if one wasn't chosen via the "--tag" command line option.
604 # Only attempt this if the compiler in the base compile
605 # command doesn't match the default compiler.
606 # arg is usually of the form 'gcc ...'
607 func_infer_tag ()
609 if test -n "$available_tags" && test -z "$tagname"; then
610 CC_quoted=
611 for arg in $CC; do
612 case $arg in
613 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
614 arg="\"$arg\""
616 esac
617 CC_quoted="$CC_quoted $arg"
618 done
619 case $@ in
620 # Blanks in the command may have been stripped by the calling shell,
621 # but not from the CC environment variable when configure was run.
622 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
623 # Blanks at the start of $base_compile will cause this to fail
624 # if we don't check for them as well.
626 for z in $available_tags; do
627 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
628 # Evaluate the configuration.
629 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
630 CC_quoted=
631 for arg in $CC; do
632 # Double-quote args containing other shell metacharacters.
633 case $arg in
634 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
635 arg="\"$arg\""
637 esac
638 CC_quoted="$CC_quoted $arg"
639 done
640 case "$@ " in
641 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
642 # The compiler in the base compile command matches
643 # the one in the tagged configuration.
644 # Assume this is the tagged configuration we want.
645 tagname=$z
646 break
648 esac
650 done
651 # If $tagname still isn't set, then no tagged configuration
652 # was found and let the user know that the "--tag" command
653 # line option must be used.
654 if test -z "$tagname"; then
655 $echo "$modename: unable to infer tagged configuration"
656 $echo "$modename: specify a tag with \`--tag'" 1>&2
657 exit $EXIT_FAILURE
658 # else
659 # $echo "$modename: using $tagname tagged configuration"
662 esac
667 # func_extract_an_archive dir oldlib
668 func_extract_an_archive ()
670 f_ex_an_ar_dir="$1"; shift
671 f_ex_an_ar_oldlib="$1"
673 $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
674 $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
675 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
677 else
678 $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
679 exit $EXIT_FAILURE
683 # func_extract_archives gentop oldlib ...
684 func_extract_archives ()
686 my_gentop="$1"; shift
687 my_oldlibs=${1+"$@"}
688 my_oldobjs=""
689 my_xlib=""
690 my_xabs=""
691 my_xdir=""
692 my_status=""
694 $show "${rm}r $my_gentop"
695 $run ${rm}r "$my_gentop"
696 $show "$mkdir $my_gentop"
697 $run $mkdir "$my_gentop"
698 my_status=$?
699 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
700 exit $my_status
703 for my_xlib in $my_oldlibs; do
704 # Extract the objects.
705 case $my_xlib in
706 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
707 *) my_xabs=`pwd`"/$my_xlib" ;;
708 esac
709 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
710 my_xlib_u=$my_xlib
711 while :; do
712 case " $extracted_archives " in
713 *" $my_xlib_u "*)
714 extracted_serial=`expr $extracted_serial + 1`
715 my_xlib_u=lt$extracted_serial-$my_xlib ;;
716 *) break ;;
717 esac
718 done
719 extracted_archives="$extracted_archives $my_xlib_u"
720 my_xdir="$my_gentop/$my_xlib_u"
722 $show "${rm}r $my_xdir"
723 $run ${rm}r "$my_xdir"
724 $show "$mkdir $my_xdir"
725 $run $mkdir "$my_xdir"
726 exit_status=$?
727 if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
728 exit $exit_status
730 case $host in
731 *-darwin*)
732 $show "Extracting $my_xabs"
733 # Do not bother doing anything if just a dry run
734 if test -z "$run"; then
735 darwin_orig_dir=`pwd`
736 cd $my_xdir || exit $?
737 darwin_archive=$my_xabs
738 darwin_curdir=`pwd`
739 darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
740 darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
741 if test -n "$darwin_arches"; then
742 darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
743 darwin_arch=
744 $show "$darwin_base_archive has multiple architectures $darwin_arches"
745 for darwin_arch in $darwin_arches ; do
746 mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
747 lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
748 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
749 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
750 cd "$darwin_curdir"
751 $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
752 done # $darwin_arches
753 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
754 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
755 darwin_file=
756 darwin_files=
757 for darwin_file in $darwin_filelist; do
758 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
759 lipo -create -output "$darwin_file" $darwin_files
760 done # $darwin_filelist
761 ${rm}r unfat-$$
762 cd "$darwin_orig_dir"
763 else
764 cd "$darwin_orig_dir"
765 func_extract_an_archive "$my_xdir" "$my_xabs"
766 fi # $darwin_arches
767 fi # $run
770 func_extract_an_archive "$my_xdir" "$my_xabs"
772 esac
773 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
774 done
775 func_extract_archives_result="$my_oldobjs"
777 # End of Shell function definitions
778 #####################################
780 # Darwin sucks
781 eval std_shrext=\"$shrext_cmds\"
783 disable_libs=no
785 # Parse our command line options once, thoroughly.
786 while test "$#" -gt 0
788 arg="$1"
789 shift
791 case $arg in
792 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
793 *) optarg= ;;
794 esac
796 # If the previous option needs an argument, assign it.
797 if test -n "$prev"; then
798 case $prev in
799 execute_dlfiles)
800 execute_dlfiles="$execute_dlfiles $arg"
802 tag)
803 tagname="$arg"
804 preserve_args="${preserve_args}=$arg"
806 # Check whether tagname contains only valid characters
807 case $tagname in
808 *[!-_A-Za-z0-9,/]*)
809 $echo "$progname: invalid tag name: $tagname" 1>&2
810 exit $EXIT_FAILURE
812 esac
814 case $tagname in
816 # Don't test for the "default" C tag, as we know, it's there, but
817 # not specially marked.
820 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
821 taglist="$taglist $tagname"
822 # Evaluate the configuration.
823 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
824 else
825 $echo "$progname: ignoring unknown tag $tagname" 1>&2
828 esac
831 eval "$prev=\$arg"
833 esac
835 prev=
836 prevopt=
837 continue
840 # Have we seen a non-optional argument yet?
841 case $arg in
842 --help)
843 show_help=yes
846 --version)
847 echo "\
848 $PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP
850 Copyright (C) 2007 Free Software Foundation, Inc.
851 This is free software; see the source for copying conditions. There is NO
852 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
853 exit $?
856 --config)
857 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
858 # Now print the configurations for the tags.
859 for tagname in $taglist; do
860 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
861 done
862 exit $?
865 --debug)
866 $echo "$progname: enabling shell trace mode"
867 set -x
868 preserve_args="$preserve_args $arg"
871 --dry-run | -n)
872 run=:
875 --features)
876 $echo "host: $host"
877 if test "$build_libtool_libs" = yes; then
878 $echo "enable shared libraries"
879 else
880 $echo "disable shared libraries"
882 if test "$build_old_libs" = yes; then
883 $echo "enable static libraries"
884 else
885 $echo "disable static libraries"
887 exit $?
890 --finish) mode="finish" ;;
892 --mode) prevopt="--mode" prev=mode ;;
893 --mode=*) mode="$optarg" ;;
895 --preserve-dup-deps) duplicate_deps="yes" ;;
897 --quiet | --silent)
898 show=:
899 preserve_args="$preserve_args $arg"
902 --tag)
903 prevopt="--tag"
904 prev=tag
905 preserve_args="$preserve_args --tag"
907 --tag=*)
908 set tag "$optarg" ${1+"$@"}
909 shift
910 prev=tag
911 preserve_args="$preserve_args --tag"
914 -dlopen)
915 prevopt="-dlopen"
916 prev=execute_dlfiles
920 $echo "$modename: unrecognized option \`$arg'" 1>&2
921 $echo "$help" 1>&2
922 exit $EXIT_FAILURE
926 nonopt="$arg"
927 break
929 esac
930 done
932 if test -n "$prevopt"; then
933 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
934 $echo "$help" 1>&2
935 exit $EXIT_FAILURE
938 case $disable_libs in
939 no)
941 shared)
942 build_libtool_libs=no
943 build_old_libs=yes
945 static)
946 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
948 esac
950 # If this variable is set in any of the actions, the command in it
951 # will be execed at the end. This prevents here-documents from being
952 # left over by shells.
953 exec_cmd=
955 if test -z "$show_help"; then
957 # Infer the operation mode.
958 if test -z "$mode"; then
959 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
960 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
961 case $nonopt in
962 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
963 mode=link
964 for arg
966 case $arg in
968 mode=compile
969 break
971 esac
972 done
974 *db | *dbx | *strace | *truss)
975 mode=execute
977 *install*|cp|mv)
978 mode=install
980 *rm)
981 mode=uninstall
984 # If we have no mode, but dlfiles were specified, then do execute mode.
985 test -n "$execute_dlfiles" && mode=execute
987 # Just use the default operation mode.
988 if test -z "$mode"; then
989 if test -n "$nonopt"; then
990 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
991 else
992 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
996 esac
999 # Only execute mode is allowed to have -dlopen flags.
1000 if test -n "$execute_dlfiles" && test "$mode" != execute; then
1001 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
1002 $echo "$help" 1>&2
1003 exit $EXIT_FAILURE
1006 # Change the help message to a mode-specific one.
1007 generic_help="$help"
1008 help="Try \`$modename --help --mode=$mode' for more information."
1010 # These modes are in order of execution frequency so that they run quickly.
1011 case $mode in
1012 # libtool compile mode
1013 compile)
1014 modename="$modename: compile"
1015 # Get the compilation command and the source file.
1016 base_compile=
1017 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
1018 suppress_opt=yes
1019 suppress_output=
1020 arg_mode=normal
1021 libobj=
1022 later=
1024 for arg
1026 case $arg_mode in
1027 arg )
1028 # do not "continue". Instead, add this to base_compile
1029 lastarg="$arg"
1030 arg_mode=normal
1033 target )
1034 libobj="$arg"
1035 arg_mode=normal
1036 continue
1039 normal )
1040 # Accept any command-line options.
1041 case $arg in
1043 if test -n "$libobj" ; then
1044 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
1045 exit $EXIT_FAILURE
1047 arg_mode=target
1048 continue
1051 -static | -prefer-pic | -prefer-non-pic)
1052 later="$later $arg"
1053 continue
1056 -no-suppress)
1057 suppress_opt=no
1058 continue
1061 -Xcompiler)
1062 arg_mode=arg # the next one goes into the "base_compile" arg list
1063 continue # The current "srcfile" will either be retained or
1064 ;; # replaced later. I would guess that would be a bug.
1066 -Wc,*)
1067 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
1068 lastarg=
1069 save_ifs="$IFS"; IFS=','
1070 for arg in $args; do
1071 IFS="$save_ifs"
1073 # Double-quote args containing other shell metacharacters.
1074 # Many Bourne shells cannot handle close brackets correctly
1075 # in scan sets, so we specify it separately.
1076 case $arg in
1077 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1078 arg="\"$arg\""
1080 esac
1081 lastarg="$lastarg $arg"
1082 done
1083 IFS="$save_ifs"
1084 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
1086 # Add the arguments to base_compile.
1087 base_compile="$base_compile $lastarg"
1088 continue
1092 # Accept the current argument as the source file.
1093 # The previous "srcfile" becomes the current argument.
1095 lastarg="$srcfile"
1096 srcfile="$arg"
1098 esac # case $arg
1100 esac # case $arg_mode
1102 # Aesthetically quote the previous argument.
1103 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
1105 case $lastarg in
1106 # Double-quote args containing other shell metacharacters.
1107 # Many Bourne shells cannot handle close brackets correctly
1108 # in scan sets, and some SunOS ksh mistreat backslash-escaping
1109 # in scan sets (worked around with variable expansion),
1110 # and furthermore cannot handle '|' '&' '(' ')' in scan sets
1111 # at all, so we specify them separately.
1112 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1113 lastarg="\"$lastarg\""
1115 esac
1117 base_compile="$base_compile $lastarg"
1118 done # for arg
1120 case $arg_mode in
1121 arg)
1122 $echo "$modename: you must specify an argument for -Xcompile"
1123 exit $EXIT_FAILURE
1125 target)
1126 $echo "$modename: you must specify a target with \`-o'" 1>&2
1127 exit $EXIT_FAILURE
1130 # Get the name of the library object.
1131 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
1133 esac
1135 # Recognize several different file suffixes.
1136 # If the user specifies -o file.o, it is replaced with file.lo
1137 xform='[cCFSifmso]'
1138 case $libobj in
1139 *.ada) xform=ada ;;
1140 *.adb) xform=adb ;;
1141 *.ads) xform=ads ;;
1142 *.asm) xform=asm ;;
1143 *.c++) xform=c++ ;;
1144 *.cc) xform=cc ;;
1145 *.ii) xform=ii ;;
1146 *.class) xform=class ;;
1147 *.cpp) xform=cpp ;;
1148 *.cxx) xform=cxx ;;
1149 *.[fF][09]?) xform=[fF][09]. ;;
1150 *.for) xform=for ;;
1151 *.java) xform=java ;;
1152 *.obj) xform=obj ;;
1153 esac
1155 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
1157 case $libobj in
1158 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
1160 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
1161 exit $EXIT_FAILURE
1163 esac
1165 func_infer_tag $base_compile
1167 for arg in $later; do
1168 case $arg in
1169 -static)
1170 build_old_libs=yes
1171 continue
1174 -prefer-pic)
1175 pic_mode=yes
1176 continue
1179 -prefer-non-pic)
1180 pic_mode=no
1181 continue
1183 esac
1184 done
1186 qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
1187 case $qlibobj in
1188 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1189 qlibobj="\"$qlibobj\"" ;;
1190 esac
1191 test "X$libobj" != "X$qlibobj" \
1192 && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
1193 && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
1194 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
1195 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
1196 if test "X$xdir" = "X$obj"; then
1197 xdir=
1198 else
1199 xdir=$xdir/
1201 lobj=${xdir}$objdir/$objname
1203 if test -z "$base_compile"; then
1204 $echo "$modename: you must specify a compilation command" 1>&2
1205 $echo "$help" 1>&2
1206 exit $EXIT_FAILURE
1209 # Delete any leftover library objects.
1210 if test "$build_old_libs" = yes; then
1211 removelist="$obj $lobj $libobj ${libobj}T"
1212 else
1213 removelist="$lobj $libobj ${libobj}T"
1216 $run $rm $removelist
1217 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1219 # On Cygwin there's no "real" PIC flag so we must build both object types
1220 case $host_os in
1221 cygwin* | mingw* | pw32* | os2*)
1222 pic_mode=default
1224 esac
1225 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
1226 # non-PIC code in shared libraries is not supported
1227 pic_mode=default
1230 # Calculate the filename of the output object if compiler does
1231 # not support -o with -c
1232 if test "$compiler_c_o" = no; then
1233 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
1234 lockfile="$output_obj.lock"
1235 removelist="$removelist $output_obj $lockfile"
1236 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1237 else
1238 output_obj=
1239 need_locks=no
1240 lockfile=
1243 # Lock this critical section if it is needed
1244 # We use this script file to make the link, it avoids creating a new file
1245 if test "$need_locks" = yes; then
1246 until $run ln "$progpath" "$lockfile" 2>/dev/null; do
1247 $show "Waiting for $lockfile to be removed"
1248 sleep 2
1249 done
1250 elif test "$need_locks" = warn; then
1251 if test -f "$lockfile"; then
1252 $echo "\
1253 *** ERROR, $lockfile exists and contains:
1254 `cat $lockfile 2>/dev/null`
1256 This indicates that another process is trying to use the same
1257 temporary object file, and libtool could not work around it because
1258 your compiler does not support \`-c' and \`-o' together. If you
1259 repeat this compilation, it may succeed, by chance, but you had better
1260 avoid parallel builds (make -j) in this platform, or get a better
1261 compiler."
1263 $run $rm $removelist
1264 exit $EXIT_FAILURE
1266 $echo "$srcfile" > "$lockfile"
1269 if test -n "$fix_srcfile_path"; then
1270 eval srcfile=\"$fix_srcfile_path\"
1272 qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
1273 case $qsrcfile in
1274 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1275 qsrcfile="\"$qsrcfile\"" ;;
1276 esac
1278 $run $rm "$libobj" "${libobj}T"
1280 # Create a libtool object file (analogous to a ".la" file),
1281 # but don't create it if we're doing a dry run.
1282 test -z "$run" && cat > ${libobj}T <<EOF
1283 # $libobj - a libtool object file
1284 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
1286 # Please DO NOT delete this file!
1287 # It is necessary for linking the library.
1289 # Name of the PIC object.
1292 # Only build a PIC object if we are building libtool libraries.
1293 if test "$build_libtool_libs" = yes; then
1294 # Without this assignment, base_compile gets emptied.
1295 fbsd_hideous_sh_bug=$base_compile
1297 if test "$pic_mode" != no; then
1298 command="$base_compile $qsrcfile $pic_flag"
1299 else
1300 # Don't build PIC code
1301 command="$base_compile $qsrcfile"
1304 if test ! -d "${xdir}$objdir"; then
1305 $show "$mkdir ${xdir}$objdir"
1306 $run $mkdir ${xdir}$objdir
1307 exit_status=$?
1308 if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
1309 exit $exit_status
1313 if test -z "$output_obj"; then
1314 # Place PIC objects in $objdir
1315 command="$command -o $lobj"
1318 $run $rm "$lobj" "$output_obj"
1320 $show "$command"
1321 if $run eval "$command"; then :
1322 else
1323 test -n "$output_obj" && $run $rm $removelist
1324 exit $EXIT_FAILURE
1327 if test "$need_locks" = warn &&
1328 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1329 $echo "\
1330 *** ERROR, $lockfile contains:
1331 `cat $lockfile 2>/dev/null`
1333 but it should contain:
1334 $srcfile
1336 This indicates that another process is trying to use the same
1337 temporary object file, and libtool could not work around it because
1338 your compiler does not support \`-c' and \`-o' together. If you
1339 repeat this compilation, it may succeed, by chance, but you had better
1340 avoid parallel builds (make -j) in this platform, or get a better
1341 compiler."
1343 $run $rm $removelist
1344 exit $EXIT_FAILURE
1347 # Just move the object if needed, then go on to compile the next one
1348 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1349 $show "$mv $output_obj $lobj"
1350 if $run $mv $output_obj $lobj; then :
1351 else
1352 error=$?
1353 $run $rm $removelist
1354 exit $error
1358 # Append the name of the PIC object to the libtool object file.
1359 test -z "$run" && cat >> ${libobj}T <<EOF
1360 pic_object='$objdir/$objname'
1364 # Allow error messages only from the first compilation.
1365 if test "$suppress_opt" = yes; then
1366 suppress_output=' >/dev/null 2>&1'
1368 else
1369 # No PIC object so indicate it doesn't exist in the libtool
1370 # object file.
1371 test -z "$run" && cat >> ${libobj}T <<EOF
1372 pic_object=none
1377 # Only build a position-dependent object if we build old libraries.
1378 if test "$build_old_libs" = yes; then
1379 if test "$pic_mode" != yes; then
1380 # Don't build PIC code
1381 command="$base_compile $qsrcfile"
1382 else
1383 command="$base_compile $qsrcfile $pic_flag"
1385 if test "$compiler_c_o" = yes; then
1386 command="$command -o $obj"
1389 # Suppress compiler output if we already did a PIC compilation.
1390 command="$command$suppress_output"
1391 $run $rm "$obj" "$output_obj"
1392 $show "$command"
1393 if $run eval "$command"; then :
1394 else
1395 $run $rm $removelist
1396 exit $EXIT_FAILURE
1399 if test "$need_locks" = warn &&
1400 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1401 $echo "\
1402 *** ERROR, $lockfile contains:
1403 `cat $lockfile 2>/dev/null`
1405 but it should contain:
1406 $srcfile
1408 This indicates that another process is trying to use the same
1409 temporary object file, and libtool could not work around it because
1410 your compiler does not support \`-c' and \`-o' together. If you
1411 repeat this compilation, it may succeed, by chance, but you had better
1412 avoid parallel builds (make -j) in this platform, or get a better
1413 compiler."
1415 $run $rm $removelist
1416 exit $EXIT_FAILURE
1419 # Just move the object if needed
1420 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1421 $show "$mv $output_obj $obj"
1422 if $run $mv $output_obj $obj; then :
1423 else
1424 error=$?
1425 $run $rm $removelist
1426 exit $error
1430 # Append the name of the non-PIC object the libtool object file.
1431 # Only append if the libtool object file exists.
1432 test -z "$run" && cat >> ${libobj}T <<EOF
1433 # Name of the non-PIC object.
1434 non_pic_object='$objname'
1437 else
1438 # Append the name of the non-PIC object the libtool object file.
1439 # Only append if the libtool object file exists.
1440 test -z "$run" && cat >> ${libobj}T <<EOF
1441 # Name of the non-PIC object.
1442 non_pic_object=none
1447 $run $mv "${libobj}T" "${libobj}"
1449 # Unlock the critical section if it was locked
1450 if test "$need_locks" != no; then
1451 $run $rm "$lockfile"
1454 exit $EXIT_SUCCESS
1457 # libtool link mode
1458 link | relink)
1459 modename="$modename: link"
1460 case $host in
1461 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1462 # It is impossible to link a dll without this setting, and
1463 # we shouldn't force the makefile maintainer to figure out
1464 # which system we are compiling for in order to pass an extra
1465 # flag for every libtool invocation.
1466 # allow_undefined=no
1468 # FIXME: Unfortunately, there are problems with the above when trying
1469 # to make a dll which has undefined symbols, in which case not
1470 # even a static library is built. For now, we need to specify
1471 # -no-undefined on the libtool link line when we can be certain
1472 # that all symbols are satisfied, otherwise we get a static library.
1473 allow_undefined=yes
1476 allow_undefined=yes
1478 esac
1479 libtool_args="$nonopt"
1480 base_compile="$nonopt $@"
1481 compile_command="$nonopt"
1482 finalize_command="$nonopt"
1484 compile_rpath=
1485 finalize_rpath=
1486 compile_shlibpath=
1487 finalize_shlibpath=
1488 convenience=
1489 old_convenience=
1490 deplibs=
1491 old_deplibs=
1492 compiler_flags=
1493 linker_flags=
1494 dllsearchpath=
1495 lib_search_path=`pwd`
1496 inst_prefix_dir=
1498 avoid_version=no
1499 dlfiles=
1500 dlprefiles=
1501 dlself=no
1502 export_dynamic=no
1503 export_symbols=
1504 export_symbols_regex=
1505 generated=
1506 libobjs=
1507 ltlibs=
1508 module=no
1509 no_install=no
1510 objs=
1511 non_pic_objects=
1512 notinst_path= # paths that contain not-installed libtool libraries
1513 precious_files_regex=
1514 prefer_static_libs=no
1515 preload=no
1516 prev=
1517 prevarg=
1518 release=
1519 rpath=
1520 xrpath=
1521 perm_rpath=
1522 temp_rpath=
1523 thread_safe=no
1524 vinfo=
1525 vinfo_number=no
1527 func_infer_tag $base_compile
1529 # We need to know -static, to get the right output filenames.
1530 for arg
1532 case $arg in
1533 -all-static | -static | -static-libtool-libs)
1534 case $arg in
1535 -all-static)
1536 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1537 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1539 if test -n "$link_static_flag"; then
1540 dlopen_self=$dlopen_self_static
1542 prefer_static_libs=yes
1544 -static)
1545 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1546 dlopen_self=$dlopen_self_static
1548 prefer_static_libs=built
1550 -static-libtool-libs)
1551 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1552 dlopen_self=$dlopen_self_static
1554 prefer_static_libs=yes
1556 esac
1557 build_libtool_libs=no
1558 build_old_libs=yes
1559 break
1561 esac
1562 done
1564 # See if our shared archives depend on static archives.
1565 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1567 # Go through the arguments, transforming them on the way.
1568 while test "$#" -gt 0; do
1569 arg="$1"
1570 shift
1571 case $arg in
1572 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1573 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1575 *) qarg=$arg ;;
1576 esac
1577 libtool_args="$libtool_args $qarg"
1579 # If the previous option needs an argument, assign it.
1580 if test -n "$prev"; then
1581 case $prev in
1582 output)
1583 compile_command="$compile_command @OUTPUT@"
1584 finalize_command="$finalize_command @OUTPUT@"
1586 esac
1588 case $prev in
1589 dlfiles|dlprefiles)
1590 if test "$preload" = no; then
1591 # Add the symbol object into the linking commands.
1592 compile_command="$compile_command @SYMFILE@"
1593 finalize_command="$finalize_command @SYMFILE@"
1594 preload=yes
1596 case $arg in
1597 *.la | *.lo) ;; # We handle these cases below.
1598 force)
1599 if test "$dlself" = no; then
1600 dlself=needless
1601 export_dynamic=yes
1603 prev=
1604 continue
1606 self)
1607 if test "$prev" = dlprefiles; then
1608 dlself=yes
1609 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1610 dlself=yes
1611 else
1612 dlself=needless
1613 export_dynamic=yes
1615 prev=
1616 continue
1619 if test "$prev" = dlfiles; then
1620 dlfiles="$dlfiles $arg"
1621 else
1622 dlprefiles="$dlprefiles $arg"
1624 prev=
1625 continue
1627 esac
1629 expsyms)
1630 export_symbols="$arg"
1631 if test ! -f "$arg"; then
1632 $echo "$modename: symbol file \`$arg' does not exist"
1633 exit $EXIT_FAILURE
1635 prev=
1636 continue
1638 expsyms_regex)
1639 export_symbols_regex="$arg"
1640 prev=
1641 continue
1643 inst_prefix)
1644 inst_prefix_dir="$arg"
1645 prev=
1646 continue
1648 precious_regex)
1649 precious_files_regex="$arg"
1650 prev=
1651 continue
1653 release)
1654 release="-$arg"
1655 prev=
1656 continue
1658 objectlist)
1659 if test -f "$arg"; then
1660 save_arg=$arg
1661 moreargs=
1662 for fil in `cat $save_arg`
1664 # moreargs="$moreargs $fil"
1665 arg=$fil
1666 # A libtool-controlled object.
1668 # Check to see that this really is a libtool object.
1669 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1670 pic_object=
1671 non_pic_object=
1673 # Read the .lo file
1674 # If there is no directory component, then add one.
1675 case $arg in
1676 */* | *\\*) . $arg ;;
1677 *) . ./$arg ;;
1678 esac
1680 if test -z "$pic_object" || \
1681 test -z "$non_pic_object" ||
1682 test "$pic_object" = none && \
1683 test "$non_pic_object" = none; then
1684 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1685 exit $EXIT_FAILURE
1688 # Extract subdirectory from the argument.
1689 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1690 if test "X$xdir" = "X$arg"; then
1691 xdir=
1692 else
1693 xdir="$xdir/"
1696 if test "$pic_object" != none; then
1697 # Prepend the subdirectory the object is found in.
1698 pic_object="$xdir$pic_object"
1700 if test "$prev" = dlfiles; then
1701 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1702 dlfiles="$dlfiles $pic_object"
1703 prev=
1704 continue
1705 else
1706 # If libtool objects are unsupported, then we need to preload.
1707 prev=dlprefiles
1711 # CHECK ME: I think I busted this. -Ossama
1712 if test "$prev" = dlprefiles; then
1713 # Preload the old-style object.
1714 dlprefiles="$dlprefiles $pic_object"
1715 prev=
1718 # A PIC object.
1719 libobjs="$libobjs $pic_object"
1720 arg="$pic_object"
1723 # Non-PIC object.
1724 if test "$non_pic_object" != none; then
1725 # Prepend the subdirectory the object is found in.
1726 non_pic_object="$xdir$non_pic_object"
1728 # A standard non-PIC object
1729 non_pic_objects="$non_pic_objects $non_pic_object"
1730 if test -z "$pic_object" || test "$pic_object" = none ; then
1731 arg="$non_pic_object"
1733 else
1734 # If the PIC object exists, use it instead.
1735 # $xdir was prepended to $pic_object above.
1736 non_pic_object="$pic_object"
1737 non_pic_objects="$non_pic_objects $non_pic_object"
1739 else
1740 # Only an error if not doing a dry-run.
1741 if test -z "$run"; then
1742 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1743 exit $EXIT_FAILURE
1744 else
1745 # Dry-run case.
1747 # Extract subdirectory from the argument.
1748 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1749 if test "X$xdir" = "X$arg"; then
1750 xdir=
1751 else
1752 xdir="$xdir/"
1755 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1756 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1757 libobjs="$libobjs $pic_object"
1758 non_pic_objects="$non_pic_objects $non_pic_object"
1761 done
1762 else
1763 $echo "$modename: link input file \`$save_arg' does not exist"
1764 exit $EXIT_FAILURE
1766 arg=$save_arg
1767 prev=
1768 continue
1770 rpath | xrpath)
1771 # We need an absolute path.
1772 case $arg in
1773 [\\/]* | [A-Za-z]:[\\/]*) ;;
1775 $echo "$modename: only absolute run-paths are allowed" 1>&2
1776 exit $EXIT_FAILURE
1778 esac
1779 if test "$prev" = rpath; then
1780 case "$rpath " in
1781 *" $arg "*) ;;
1782 *) rpath="$rpath $arg" ;;
1783 esac
1784 else
1785 case "$xrpath " in
1786 *" $arg "*) ;;
1787 *) xrpath="$xrpath $arg" ;;
1788 esac
1790 prev=
1791 continue
1793 xcompiler)
1794 compiler_flags="$compiler_flags $qarg"
1795 prev=
1796 compile_command="$compile_command $qarg"
1797 finalize_command="$finalize_command $qarg"
1798 continue
1800 xlinker)
1801 linker_flags="$linker_flags $qarg"
1802 compiler_flags="$compiler_flags $wl$qarg"
1803 prev=
1804 compile_command="$compile_command $wl$qarg"
1805 finalize_command="$finalize_command $wl$qarg"
1806 continue
1808 xcclinker)
1809 linker_flags="$linker_flags $qarg"
1810 compiler_flags="$compiler_flags $qarg"
1811 prev=
1812 compile_command="$compile_command $qarg"
1813 finalize_command="$finalize_command $qarg"
1814 continue
1816 shrext)
1817 shrext_cmds="$arg"
1818 prev=
1819 continue
1821 darwin_framework|darwin_framework_skip)
1822 test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
1823 compile_command="$compile_command $arg"
1824 finalize_command="$finalize_command $arg"
1825 prev=
1826 continue
1829 eval "$prev=\"\$arg\""
1830 prev=
1831 continue
1833 esac
1834 fi # test -n "$prev"
1836 prevarg="$arg"
1838 case $arg in
1839 -all-static)
1840 if test -n "$link_static_flag"; then
1841 compile_command="$compile_command $link_static_flag"
1842 finalize_command="$finalize_command $link_static_flag"
1844 continue
1847 -allow-undefined)
1848 # FIXME: remove this flag sometime in the future.
1849 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1850 continue
1853 -avoid-version)
1854 avoid_version=yes
1855 continue
1858 -dlopen)
1859 prev=dlfiles
1860 continue
1863 -dlpreopen)
1864 prev=dlprefiles
1865 continue
1868 -export-dynamic)
1869 export_dynamic=yes
1870 continue
1873 -export-symbols | -export-symbols-regex)
1874 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1875 $echo "$modename: more than one -exported-symbols argument is not allowed"
1876 exit $EXIT_FAILURE
1878 if test "X$arg" = "X-export-symbols"; then
1879 prev=expsyms
1880 else
1881 prev=expsyms_regex
1883 continue
1886 -framework|-arch|-isysroot)
1887 case " $CC " in
1888 *" ${arg} ${1} "* | *" ${arg} ${1} "*)
1889 prev=darwin_framework_skip ;;
1890 *) compiler_flags="$compiler_flags $arg"
1891 prev=darwin_framework ;;
1892 esac
1893 compile_command="$compile_command $arg"
1894 finalize_command="$finalize_command $arg"
1895 continue
1898 -inst-prefix-dir)
1899 prev=inst_prefix
1900 continue
1903 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1904 # so, if we see these flags be careful not to treat them like -L
1905 -L[A-Z][A-Z]*:*)
1906 case $with_gcc/$host in
1907 no/*-*-irix* | /*-*-irix*)
1908 compile_command="$compile_command $arg"
1909 finalize_command="$finalize_command $arg"
1911 esac
1912 continue
1915 -L*)
1916 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1917 # We need an absolute path.
1918 case $dir in
1919 [\\/]* | [A-Za-z]:[\\/]*) ;;
1921 absdir=`cd "$dir" && pwd`
1922 if test -z "$absdir"; then
1923 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1924 absdir="$dir"
1925 notinst_path="$notinst_path $dir"
1927 dir="$absdir"
1929 esac
1930 case "$deplibs " in
1931 *" -L$dir "*) ;;
1933 deplibs="$deplibs -L$dir"
1934 lib_search_path="$lib_search_path $dir"
1936 esac
1937 case $host in
1938 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1939 testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1940 case :$dllsearchpath: in
1941 *":$dir:"*) ;;
1942 *) dllsearchpath="$dllsearchpath:$dir";;
1943 esac
1944 case :$dllsearchpath: in
1945 *":$testbindir:"*) ;;
1946 *) dllsearchpath="$dllsearchpath:$testbindir";;
1947 esac
1949 esac
1950 continue
1953 -l*)
1954 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1955 case $host in
1956 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
1957 # These systems don't actually have a C or math library (as such)
1958 continue
1960 *-*-os2*)
1961 # These systems don't actually have a C library (as such)
1962 test "X$arg" = "X-lc" && continue
1964 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1965 # Do not include libc due to us having libc/libc_r.
1966 test "X$arg" = "X-lc" && continue
1968 *-*-rhapsody* | *-*-darwin1.[012])
1969 # Rhapsody C and math libraries are in the System framework
1970 deplibs="$deplibs -framework System"
1971 continue
1973 *-*-sco3.2v5* | *-*-sco5v6*)
1974 # Causes problems with __ctype
1975 test "X$arg" = "X-lc" && continue
1977 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
1978 # Compiler inserts libc in the correct place for threads to work
1979 test "X$arg" = "X-lc" && continue
1981 esac
1982 elif test "X$arg" = "X-lc_r"; then
1983 case $host in
1984 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1985 # Do not include libc_r directly, use -pthread flag.
1986 continue
1988 esac
1990 deplibs="$deplibs $arg"
1991 continue
1994 # Tru64 UNIX uses -model [arg] to determine the layout of C++
1995 # classes, name mangling, and exception handling.
1996 -model)
1997 compile_command="$compile_command $arg"
1998 compiler_flags="$compiler_flags $arg"
1999 finalize_command="$finalize_command $arg"
2000 prev=xcompiler
2001 continue
2004 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
2005 compiler_flags="$compiler_flags $arg"
2006 compile_command="$compile_command $arg"
2007 finalize_command="$finalize_command $arg"
2008 continue
2011 -module)
2012 module=yes
2013 continue
2016 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
2017 # -r[0-9][0-9]* specifies the processor on the SGI compiler
2018 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
2019 # +DA*, +DD* enable 64-bit mode on the HP compiler
2020 # -q* pass through compiler args for the IBM compiler
2021 # -m* pass through architecture-specific compiler args for GCC
2022 # -m*, -t[45]*, -txscale* pass through architecture-specific
2023 # compiler args for GCC
2024 # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
2025 # -F/path gives path to uninstalled frameworks, gcc on darwin
2026 # @file GCC response files
2027 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
2028 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
2030 # Unknown arguments in both finalize_command and compile_command need
2031 # to be aesthetically quoted because they are evaled later.
2032 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2033 case $arg in
2034 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2035 arg="\"$arg\""
2037 esac
2038 compile_command="$compile_command $arg"
2039 finalize_command="$finalize_command $arg"
2040 compiler_flags="$compiler_flags $arg"
2041 continue
2044 -shrext)
2045 prev=shrext
2046 continue
2049 -no-fast-install)
2050 fast_install=no
2051 continue
2054 -no-install)
2055 case $host in
2056 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
2057 # The PATH hackery in wrapper scripts is required on Windows
2058 # and Darwin in order for the loader to find any dlls it needs.
2059 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
2060 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
2061 fast_install=no
2063 *) no_install=yes ;;
2064 esac
2065 continue
2068 -no-undefined)
2069 allow_undefined=no
2070 continue
2073 -objectlist)
2074 prev=objectlist
2075 continue
2078 -o) prev=output ;;
2080 -precious-files-regex)
2081 prev=precious_regex
2082 continue
2085 -release)
2086 prev=release
2087 continue
2090 -rpath)
2091 prev=rpath
2092 continue
2096 prev=xrpath
2097 continue
2100 -R*)
2101 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
2102 # We need an absolute path.
2103 case $dir in
2104 [\\/]* | [A-Za-z]:[\\/]*) ;;
2106 $echo "$modename: only absolute run-paths are allowed" 1>&2
2107 exit $EXIT_FAILURE
2109 esac
2110 case "$xrpath " in
2111 *" $dir "*) ;;
2112 *) xrpath="$xrpath $dir" ;;
2113 esac
2114 continue
2117 -static | -static-libtool-libs)
2118 # The effects of -static are defined in a previous loop.
2119 # We used to do the same as -all-static on platforms that
2120 # didn't have a PIC flag, but the assumption that the effects
2121 # would be equivalent was wrong. It would break on at least
2122 # Digital Unix and AIX.
2123 continue
2126 -thread-safe)
2127 thread_safe=yes
2128 continue
2131 -version-info)
2132 prev=vinfo
2133 continue
2135 -version-number)
2136 prev=vinfo
2137 vinfo_number=yes
2138 continue
2141 -Wc,*)
2142 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
2143 arg=
2144 save_ifs="$IFS"; IFS=','
2145 for flag in $args; do
2146 IFS="$save_ifs"
2147 case $flag in
2148 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2149 flag="\"$flag\""
2151 esac
2152 arg="$arg $wl$flag"
2153 compiler_flags="$compiler_flags $flag"
2154 done
2155 IFS="$save_ifs"
2156 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
2159 -Wl,*)
2160 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
2161 arg=
2162 save_ifs="$IFS"; IFS=','
2163 for flag in $args; do
2164 IFS="$save_ifs"
2165 case $flag in
2166 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2167 flag="\"$flag\""
2169 esac
2170 arg="$arg $wl$flag"
2171 compiler_flags="$compiler_flags $wl$flag"
2172 linker_flags="$linker_flags $flag"
2173 done
2174 IFS="$save_ifs"
2175 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
2178 -Xcompiler)
2179 prev=xcompiler
2180 continue
2183 -Xlinker)
2184 prev=xlinker
2185 continue
2188 -XCClinker)
2189 prev=xcclinker
2190 continue
2193 # Some other compiler flag.
2194 -* | +*)
2195 # Unknown arguments in both finalize_command and compile_command need
2196 # to be aesthetically quoted because they are evaled later.
2197 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2198 case $arg in
2199 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2200 arg="\"$arg\""
2202 esac
2205 *.$objext)
2206 # A standard object.
2207 objs="$objs $arg"
2210 *.lo)
2211 # A libtool-controlled object.
2213 # Check to see that this really is a libtool object.
2214 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2215 pic_object=
2216 non_pic_object=
2218 # Read the .lo file
2219 # If there is no directory component, then add one.
2220 case $arg in
2221 */* | *\\*) . $arg ;;
2222 *) . ./$arg ;;
2223 esac
2225 if test -z "$pic_object" || \
2226 test -z "$non_pic_object" ||
2227 test "$pic_object" = none && \
2228 test "$non_pic_object" = none; then
2229 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
2230 exit $EXIT_FAILURE
2233 # Extract subdirectory from the argument.
2234 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2235 if test "X$xdir" = "X$arg"; then
2236 xdir=
2237 else
2238 xdir="$xdir/"
2241 if test "$pic_object" != none; then
2242 # Prepend the subdirectory the object is found in.
2243 pic_object="$xdir$pic_object"
2245 if test "$prev" = dlfiles; then
2246 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
2247 dlfiles="$dlfiles $pic_object"
2248 prev=
2249 continue
2250 else
2251 # If libtool objects are unsupported, then we need to preload.
2252 prev=dlprefiles
2256 # CHECK ME: I think I busted this. -Ossama
2257 if test "$prev" = dlprefiles; then
2258 # Preload the old-style object.
2259 dlprefiles="$dlprefiles $pic_object"
2260 prev=
2263 # A PIC object.
2264 libobjs="$libobjs $pic_object"
2265 arg="$pic_object"
2268 # Non-PIC object.
2269 if test "$non_pic_object" != none; then
2270 # Prepend the subdirectory the object is found in.
2271 non_pic_object="$xdir$non_pic_object"
2273 # A standard non-PIC object
2274 non_pic_objects="$non_pic_objects $non_pic_object"
2275 if test -z "$pic_object" || test "$pic_object" = none ; then
2276 arg="$non_pic_object"
2278 else
2279 # If the PIC object exists, use it instead.
2280 # $xdir was prepended to $pic_object above.
2281 non_pic_object="$pic_object"
2282 non_pic_objects="$non_pic_objects $non_pic_object"
2284 else
2285 # Only an error if not doing a dry-run.
2286 if test -z "$run"; then
2287 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
2288 exit $EXIT_FAILURE
2289 else
2290 # Dry-run case.
2292 # Extract subdirectory from the argument.
2293 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2294 if test "X$xdir" = "X$arg"; then
2295 xdir=
2296 else
2297 xdir="$xdir/"
2300 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
2301 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
2302 libobjs="$libobjs $pic_object"
2303 non_pic_objects="$non_pic_objects $non_pic_object"
2308 *.$libext)
2309 # An archive.
2310 deplibs="$deplibs $arg"
2311 old_deplibs="$old_deplibs $arg"
2312 continue
2315 *.la)
2316 # A libtool-controlled library.
2318 if test "$prev" = dlfiles; then
2319 # This library was specified with -dlopen.
2320 dlfiles="$dlfiles $arg"
2321 prev=
2322 elif test "$prev" = dlprefiles; then
2323 # The library was specified with -dlpreopen.
2324 dlprefiles="$dlprefiles $arg"
2325 prev=
2326 else
2327 deplibs="$deplibs $arg"
2329 continue
2332 # Some other compiler argument.
2334 # Unknown arguments in both finalize_command and compile_command need
2335 # to be aesthetically quoted because they are evaled later.
2336 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2337 case $arg in
2338 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2339 arg="\"$arg\""
2341 esac
2343 esac # arg
2345 # Now actually substitute the argument into the commands.
2346 if test -n "$arg"; then
2347 compile_command="$compile_command $arg"
2348 finalize_command="$finalize_command $arg"
2350 done # argument parsing loop
2352 if test -n "$prev"; then
2353 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
2354 $echo "$help" 1>&2
2355 exit $EXIT_FAILURE
2358 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
2359 eval arg=\"$export_dynamic_flag_spec\"
2360 compile_command="$compile_command $arg"
2361 finalize_command="$finalize_command $arg"
2364 oldlibs=
2365 # calculate the name of the file, without its directory
2366 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
2367 libobjs_save="$libobjs"
2369 if test -n "$shlibpath_var"; then
2370 # get the directories listed in $shlibpath_var
2371 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2372 else
2373 shlib_search_path=
2375 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
2376 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
2378 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2379 if test "X$output_objdir" = "X$output"; then
2380 output_objdir="$objdir"
2381 else
2382 output_objdir="$output_objdir/$objdir"
2384 # Create the object directory.
2385 if test ! -d "$output_objdir"; then
2386 $show "$mkdir $output_objdir"
2387 $run $mkdir $output_objdir
2388 exit_status=$?
2389 if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
2390 exit $exit_status
2394 # Determine the type of output
2395 case $output in
2397 $echo "$modename: you must specify an output file" 1>&2
2398 $echo "$help" 1>&2
2399 exit $EXIT_FAILURE
2401 *.$libext) linkmode=oldlib ;;
2402 *.lo | *.$objext) linkmode=obj ;;
2403 *.la) linkmode=lib ;;
2404 *) linkmode=prog ;; # Anything else should be a program.
2405 esac
2407 case $host in
2408 *cygwin* | *mingw* | *pw32*)
2409 # don't eliminate duplications in $postdeps and $predeps
2410 duplicate_compiler_generated_deps=yes
2413 duplicate_compiler_generated_deps=$duplicate_deps
2415 esac
2416 specialdeplibs=
2418 libs=
2419 # Find all interdependent deplibs by searching for libraries
2420 # that are linked more than once (e.g. -la -lb -la)
2421 for deplib in $deplibs; do
2422 if test "X$duplicate_deps" = "Xyes" ; then
2423 case "$libs " in
2424 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2425 esac
2427 libs="$libs $deplib"
2428 done
2430 if test "$linkmode" = lib; then
2431 libs="$predeps $libs $compiler_lib_search_path $postdeps"
2433 # Compute libraries that are listed more than once in $predeps
2434 # $postdeps and mark them as special (i.e., whose duplicates are
2435 # not to be eliminated).
2436 pre_post_deps=
2437 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2438 for pre_post_dep in $predeps $postdeps; do
2439 case "$pre_post_deps " in
2440 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
2441 esac
2442 pre_post_deps="$pre_post_deps $pre_post_dep"
2443 done
2445 pre_post_deps=
2448 deplibs=
2449 newdependency_libs=
2450 newlib_search_path=
2451 need_relink=no # whether we're linking any uninstalled libtool libraries
2452 notinst_deplibs= # not-installed libtool libraries
2453 case $linkmode in
2454 lib)
2455 passes="conv link"
2456 for file in $dlfiles $dlprefiles; do
2457 case $file in
2458 *.la) ;;
2460 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2461 exit $EXIT_FAILURE
2463 esac
2464 done
2466 prog)
2467 compile_deplibs=
2468 finalize_deplibs=
2469 alldeplibs=no
2470 newdlfiles=
2471 newdlprefiles=
2472 passes="conv scan dlopen dlpreopen link"
2474 *) passes="conv"
2476 esac
2477 for pass in $passes; do
2478 if test "$linkmode,$pass" = "lib,link" ||
2479 test "$linkmode,$pass" = "prog,scan"; then
2480 libs="$deplibs"
2481 deplibs=
2483 if test "$linkmode" = prog; then
2484 case $pass in
2485 dlopen) libs="$dlfiles" ;;
2486 dlpreopen) libs="$dlprefiles" ;;
2487 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2488 esac
2490 if test "$pass" = dlopen; then
2491 # Collect dlpreopened libraries
2492 save_deplibs="$deplibs"
2493 deplibs=
2495 for deplib in $libs; do
2496 lib=
2497 found=no
2498 case $deplib in
2499 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
2500 if test "$linkmode,$pass" = "prog,link"; then
2501 compile_deplibs="$deplib $compile_deplibs"
2502 finalize_deplibs="$deplib $finalize_deplibs"
2503 else
2504 compiler_flags="$compiler_flags $deplib"
2506 continue
2508 -l*)
2509 if test "$linkmode" != lib && test "$linkmode" != prog; then
2510 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2511 continue
2513 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2514 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2515 for search_ext in .la $std_shrext .so .a; do
2516 # Search the libtool library
2517 lib="$searchdir/lib${name}${search_ext}"
2518 if test -f "$lib"; then
2519 if test "$search_ext" = ".la"; then
2520 found=yes
2521 else
2522 found=no
2524 break 2
2526 done
2527 done
2528 if test "$found" != yes; then
2529 # deplib doesn't seem to be a libtool library
2530 if test "$linkmode,$pass" = "prog,link"; then
2531 compile_deplibs="$deplib $compile_deplibs"
2532 finalize_deplibs="$deplib $finalize_deplibs"
2533 else
2534 deplibs="$deplib $deplibs"
2535 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2537 continue
2538 else # deplib is a libtool library
2539 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2540 # We need to do some special things here, and not later.
2541 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2542 case " $predeps $postdeps " in
2543 *" $deplib "*)
2544 if (${SED} -e '2q' $lib |
2545 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2546 library_names=
2547 old_library=
2548 case $lib in
2549 */* | *\\*) . $lib ;;
2550 *) . ./$lib ;;
2551 esac
2552 for l in $old_library $library_names; do
2553 ll="$l"
2554 done
2555 if test "X$ll" = "X$old_library" ; then # only static version available
2556 found=no
2557 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2558 test "X$ladir" = "X$lib" && ladir="."
2559 lib=$ladir/$old_library
2560 if test "$linkmode,$pass" = "prog,link"; then
2561 compile_deplibs="$deplib $compile_deplibs"
2562 finalize_deplibs="$deplib $finalize_deplibs"
2563 else
2564 deplibs="$deplib $deplibs"
2565 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2567 continue
2571 *) ;;
2572 esac
2575 ;; # -l
2576 -L*)
2577 case $linkmode in
2578 lib)
2579 deplibs="$deplib $deplibs"
2580 test "$pass" = conv && continue
2581 newdependency_libs="$deplib $newdependency_libs"
2582 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2584 prog)
2585 if test "$pass" = conv; then
2586 deplibs="$deplib $deplibs"
2587 continue
2589 if test "$pass" = scan; then
2590 deplibs="$deplib $deplibs"
2591 else
2592 compile_deplibs="$deplib $compile_deplibs"
2593 finalize_deplibs="$deplib $finalize_deplibs"
2595 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2598 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2600 esac # linkmode
2601 continue
2602 ;; # -L
2603 -R*)
2604 if test "$pass" = link; then
2605 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2606 # Make sure the xrpath contains only unique directories.
2607 case "$xrpath " in
2608 *" $dir "*) ;;
2609 *) xrpath="$xrpath $dir" ;;
2610 esac
2612 deplibs="$deplib $deplibs"
2613 continue
2615 *.la) lib="$deplib" ;;
2616 *.$libext)
2617 if test "$pass" = conv; then
2618 deplibs="$deplib $deplibs"
2619 continue
2621 case $linkmode in
2622 lib)
2623 valid_a_lib=no
2624 case $deplibs_check_method in
2625 match_pattern*)
2626 set dummy $deplibs_check_method
2627 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2628 if eval $echo \"$deplib\" 2>/dev/null \
2629 | $SED 10q \
2630 | $EGREP "$match_pattern_regex" > /dev/null; then
2631 valid_a_lib=yes
2634 pass_all)
2635 valid_a_lib=yes
2637 esac
2638 if test "$valid_a_lib" != yes; then
2639 $echo
2640 $echo "*** Warning: Trying to link with static lib archive $deplib."
2641 $echo "*** I have the capability to make that library automatically link in when"
2642 $echo "*** you link to this library. But I can only do this if you have a"
2643 $echo "*** shared version of the library, which you do not appear to have"
2644 $echo "*** because the file extensions .$libext of this argument makes me believe"
2645 $echo "*** that it is just a static archive that I should not used here."
2646 else
2647 $echo
2648 $echo "*** Warning: Linking the shared library $output against the"
2649 $echo "*** static library $deplib is not portable!"
2650 deplibs="$deplib $deplibs"
2652 continue
2654 prog)
2655 if test "$pass" != link; then
2656 deplibs="$deplib $deplibs"
2657 else
2658 compile_deplibs="$deplib $compile_deplibs"
2659 finalize_deplibs="$deplib $finalize_deplibs"
2661 continue
2663 esac # linkmode
2664 ;; # *.$libext
2665 *.lo | *.$objext)
2666 if test "$pass" = conv; then
2667 deplibs="$deplib $deplibs"
2668 elif test "$linkmode" = prog; then
2669 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2670 # If there is no dlopen support or we're linking statically,
2671 # we need to preload.
2672 newdlprefiles="$newdlprefiles $deplib"
2673 compile_deplibs="$deplib $compile_deplibs"
2674 finalize_deplibs="$deplib $finalize_deplibs"
2675 else
2676 newdlfiles="$newdlfiles $deplib"
2679 continue
2681 %DEPLIBS%)
2682 alldeplibs=yes
2683 continue
2685 esac # case $deplib
2686 if test "$found" = yes || test -f "$lib"; then :
2687 else
2688 $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
2689 exit $EXIT_FAILURE
2692 # Check to see that this really is a libtool archive.
2693 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2694 else
2695 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2696 exit $EXIT_FAILURE
2699 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2700 test "X$ladir" = "X$lib" && ladir="."
2702 dlname=
2703 dlopen=
2704 dlpreopen=
2705 libdir=
2706 library_names=
2707 old_library=
2708 # If the library was installed with an old release of libtool,
2709 # it will not redefine variables installed, or shouldnotlink
2710 installed=yes
2711 shouldnotlink=no
2712 avoidtemprpath=
2715 # Read the .la file
2716 case $lib in
2717 */* | *\\*) . $lib ;;
2718 *) . ./$lib ;;
2719 esac
2721 if test "$linkmode,$pass" = "lib,link" ||
2722 test "$linkmode,$pass" = "prog,scan" ||
2723 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2724 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2725 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2728 if test "$pass" = conv; then
2729 # Only check for convenience libraries
2730 deplibs="$lib $deplibs"
2731 if test -z "$libdir"; then
2732 if test -z "$old_library"; then
2733 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2734 exit $EXIT_FAILURE
2736 # It is a libtool convenience library, so add in its objects.
2737 convenience="$convenience $ladir/$objdir/$old_library"
2738 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2739 tmp_libs=
2740 for deplib in $dependency_libs; do
2741 deplibs="$deplib $deplibs"
2742 if test "X$duplicate_deps" = "Xyes" ; then
2743 case "$tmp_libs " in
2744 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2745 esac
2747 tmp_libs="$tmp_libs $deplib"
2748 done
2749 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2750 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2751 exit $EXIT_FAILURE
2753 continue
2754 fi # $pass = conv
2757 # Get the name of the library we link against.
2758 linklib=
2759 for l in $old_library $library_names; do
2760 linklib="$l"
2761 done
2762 if test -z "$linklib"; then
2763 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2764 exit $EXIT_FAILURE
2767 # This library was specified with -dlopen.
2768 if test "$pass" = dlopen; then
2769 if test -z "$libdir"; then
2770 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2771 exit $EXIT_FAILURE
2773 if test -z "$dlname" ||
2774 test "$dlopen_support" != yes ||
2775 test "$build_libtool_libs" = no; then
2776 # If there is no dlname, no dlopen support or we're linking
2777 # statically, we need to preload. We also need to preload any
2778 # dependent libraries so libltdl's deplib preloader doesn't
2779 # bomb out in the load deplibs phase.
2780 dlprefiles="$dlprefiles $lib $dependency_libs"
2781 else
2782 newdlfiles="$newdlfiles $lib"
2784 continue
2785 fi # $pass = dlopen
2787 # We need an absolute path.
2788 case $ladir in
2789 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2791 abs_ladir=`cd "$ladir" && pwd`
2792 if test -z "$abs_ladir"; then
2793 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2794 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2795 abs_ladir="$ladir"
2798 esac
2799 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2801 # Find the relevant object directory and library name.
2802 if test "X$installed" = Xyes; then
2803 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2804 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2805 dir="$ladir"
2806 absdir="$abs_ladir"
2807 libdir="$abs_ladir"
2808 else
2809 dir="$libdir"
2810 absdir="$libdir"
2812 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2813 else
2814 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2815 dir="$ladir"
2816 absdir="$abs_ladir"
2817 # Remove this search path later
2818 notinst_path="$notinst_path $abs_ladir"
2819 else
2820 dir="$ladir/$objdir"
2821 absdir="$abs_ladir/$objdir"
2822 # Remove this search path later
2823 notinst_path="$notinst_path $abs_ladir"
2825 fi # $installed = yes
2826 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2828 # This library was specified with -dlpreopen.
2829 if test "$pass" = dlpreopen; then
2830 if test -z "$libdir"; then
2831 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2832 exit $EXIT_FAILURE
2834 # Prefer using a static library (so that no silly _DYNAMIC symbols
2835 # are required to link).
2836 if test -n "$old_library"; then
2837 newdlprefiles="$newdlprefiles $dir/$old_library"
2838 # Otherwise, use the dlname, so that lt_dlopen finds it.
2839 elif test -n "$dlname"; then
2840 newdlprefiles="$newdlprefiles $dir/$dlname"
2841 else
2842 newdlprefiles="$newdlprefiles $dir/$linklib"
2844 fi # $pass = dlpreopen
2846 if test -z "$libdir"; then
2847 # Link the convenience library
2848 if test "$linkmode" = lib; then
2849 deplibs="$dir/$old_library $deplibs"
2850 elif test "$linkmode,$pass" = "prog,link"; then
2851 compile_deplibs="$dir/$old_library $compile_deplibs"
2852 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2853 else
2854 deplibs="$lib $deplibs" # used for prog,scan pass
2856 continue
2860 if test "$linkmode" = prog && test "$pass" != link; then
2861 newlib_search_path="$newlib_search_path $ladir"
2862 deplibs="$lib $deplibs"
2864 linkalldeplibs=no
2865 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2866 test "$build_libtool_libs" = no; then
2867 linkalldeplibs=yes
2870 tmp_libs=
2871 for deplib in $dependency_libs; do
2872 case $deplib in
2873 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2874 esac
2875 # Need to link against all dependency_libs?
2876 if test "$linkalldeplibs" = yes; then
2877 deplibs="$deplib $deplibs"
2878 else
2879 # Need to hardcode shared library paths
2880 # or/and link against static libraries
2881 newdependency_libs="$deplib $newdependency_libs"
2883 if test "X$duplicate_deps" = "Xyes" ; then
2884 case "$tmp_libs " in
2885 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2886 esac
2888 tmp_libs="$tmp_libs $deplib"
2889 done # for deplib
2890 continue
2891 fi # $linkmode = prog...
2893 if test "$linkmode,$pass" = "prog,link"; then
2894 if test -n "$library_names" &&
2895 { { test "$prefer_static_libs" = no ||
2896 test "$prefer_static_libs,$installed" = "built,yes"; } ||
2897 test -z "$old_library"; }; then
2898 # We need to hardcode the library path
2899 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2900 # Make sure the rpath contains only unique directories.
2901 case "$temp_rpath " in
2902 *" $dir "*) ;;
2903 *" $absdir "*) ;;
2904 *) temp_rpath="$temp_rpath $absdir" ;;
2905 esac
2908 # Hardcode the library path.
2909 # Skip directories that are in the system default run-time
2910 # search path.
2911 case " $sys_lib_dlsearch_path " in
2912 *" $absdir "*) ;;
2914 case "$compile_rpath " in
2915 *" $absdir "*) ;;
2916 *) compile_rpath="$compile_rpath $absdir"
2917 esac
2919 esac
2920 case " $sys_lib_dlsearch_path " in
2921 *" $libdir "*) ;;
2923 case "$finalize_rpath " in
2924 *" $libdir "*) ;;
2925 *) finalize_rpath="$finalize_rpath $libdir"
2926 esac
2928 esac
2929 fi # $linkmode,$pass = prog,link...
2931 if test "$alldeplibs" = yes &&
2932 { test "$deplibs_check_method" = pass_all ||
2933 { test "$build_libtool_libs" = yes &&
2934 test -n "$library_names"; }; }; then
2935 # We only need to search for static libraries
2936 continue
2940 link_static=no # Whether the deplib will be linked statically
2941 use_static_libs=$prefer_static_libs
2942 if test "$use_static_libs" = built && test "$installed" = yes ; then
2943 use_static_libs=no
2945 if test -n "$library_names" &&
2946 { test "$use_static_libs" = no || test -z "$old_library"; }; then
2947 if test "$installed" = no; then
2948 notinst_deplibs="$notinst_deplibs $lib"
2949 need_relink=yes
2951 # This is a shared library
2953 # Warn about portability, can't link against -module's on
2954 # some systems (darwin)
2955 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2956 $echo
2957 if test "$linkmode" = prog; then
2958 $echo "*** Warning: Linking the executable $output against the loadable module"
2959 else
2960 $echo "*** Warning: Linking the shared library $output against the loadable module"
2962 $echo "*** $linklib is not portable!"
2964 if test "$linkmode" = lib &&
2965 test "$hardcode_into_libs" = yes; then
2966 # Hardcode the library path.
2967 # Skip directories that are in the system default run-time
2968 # search path.
2969 case " $sys_lib_dlsearch_path " in
2970 *" $absdir "*) ;;
2972 case "$compile_rpath " in
2973 *" $absdir "*) ;;
2974 *) compile_rpath="$compile_rpath $absdir"
2975 esac
2977 esac
2978 case " $sys_lib_dlsearch_path " in
2979 *" $libdir "*) ;;
2981 case "$finalize_rpath " in
2982 *" $libdir "*) ;;
2983 *) finalize_rpath="$finalize_rpath $libdir"
2984 esac
2986 esac
2989 if test -n "$old_archive_from_expsyms_cmds"; then
2990 # figure out the soname
2991 set dummy $library_names
2992 realname="$2"
2993 shift; shift
2994 libname=`eval \\$echo \"$libname_spec\"`
2995 # use dlname if we got it. it's perfectly good, no?
2996 if test -n "$dlname"; then
2997 soname="$dlname"
2998 elif test -n "$soname_spec"; then
2999 # bleh windows
3000 case $host in
3001 *cygwin* | mingw*)
3002 major=`expr $current - $age`
3003 versuffix="-$major"
3005 esac
3006 eval soname=\"$soname_spec\"
3007 else
3008 soname="$realname"
3011 # Make a new name for the extract_expsyms_cmds to use
3012 soroot="$soname"
3013 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
3014 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
3016 # If the library has no export list, then create one now
3017 if test -f "$output_objdir/$soname-def"; then :
3018 else
3019 $show "extracting exported symbol list from \`$soname'"
3020 save_ifs="$IFS"; IFS='~'
3021 cmds=$extract_expsyms_cmds
3022 for cmd in $cmds; do
3023 IFS="$save_ifs"
3024 eval cmd=\"$cmd\"
3025 $show "$cmd"
3026 $run eval "$cmd" || exit $?
3027 done
3028 IFS="$save_ifs"
3031 # Create $newlib
3032 if test -f "$output_objdir/$newlib"; then :; else
3033 $show "generating import library for \`$soname'"
3034 save_ifs="$IFS"; IFS='~'
3035 cmds=$old_archive_from_expsyms_cmds
3036 for cmd in $cmds; do
3037 IFS="$save_ifs"
3038 eval cmd=\"$cmd\"
3039 $show "$cmd"
3040 $run eval "$cmd" || exit $?
3041 done
3042 IFS="$save_ifs"
3044 # make sure the library variables are pointing to the new library
3045 dir=$output_objdir
3046 linklib=$newlib
3047 fi # test -n "$old_archive_from_expsyms_cmds"
3049 if test "$linkmode" = prog || test "$mode" != relink; then
3050 add_shlibpath=
3051 add_dir=
3052 add=
3053 lib_linked=yes
3054 case $hardcode_action in
3055 immediate | unsupported)
3056 if test "$hardcode_direct" = no; then
3057 add="$dir/$linklib"
3058 case $host in
3059 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
3060 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
3061 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
3062 *-*-unixware7*) add_dir="-L$dir" ;;
3063 *-*-darwin* )
3064 # if the lib is a module then we can not link against
3065 # it, someone is ignoring the new warnings I added
3066 if /usr/bin/file -L $add 2> /dev/null |
3067 $EGREP ": [^:]* bundle" >/dev/null ; then
3068 $echo "** Warning, lib $linklib is a module, not a shared library"
3069 if test -z "$old_library" ; then
3070 $echo
3071 $echo "** And there doesn't seem to be a static archive available"
3072 $echo "** The link will probably fail, sorry"
3073 else
3074 add="$dir/$old_library"
3077 esac
3078 elif test "$hardcode_minus_L" = no; then
3079 case $host in
3080 *-*-sunos*) add_shlibpath="$dir" ;;
3081 esac
3082 add_dir="-L$dir"
3083 add="-l$name"
3084 elif test "$hardcode_shlibpath_var" = no; then
3085 add_shlibpath="$dir"
3086 add="-l$name"
3087 else
3088 lib_linked=no
3091 relink)
3092 if test "$hardcode_direct" = yes; then
3093 add="$dir/$linklib"
3094 elif test "$hardcode_minus_L" = yes; then
3095 add_dir="-L$dir"
3096 # Try looking first in the location we're being installed to.
3097 if test -n "$inst_prefix_dir"; then
3098 case $libdir in
3099 [\\/]*)
3100 add_dir="$add_dir -L$inst_prefix_dir$libdir"
3102 esac
3104 add="-l$name"
3105 elif test "$hardcode_shlibpath_var" = yes; then
3106 add_shlibpath="$dir"
3107 add="-l$name"
3108 else
3109 lib_linked=no
3112 *) lib_linked=no ;;
3113 esac
3115 if test "$lib_linked" != yes; then
3116 $echo "$modename: configuration error: unsupported hardcode properties"
3117 exit $EXIT_FAILURE
3120 if test -n "$add_shlibpath"; then
3121 case :$compile_shlibpath: in
3122 *":$add_shlibpath:"*) ;;
3123 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
3124 esac
3126 if test "$linkmode" = prog; then
3127 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
3128 test -n "$add" && compile_deplibs="$add $compile_deplibs"
3129 else
3130 test -n "$add_dir" && deplibs="$add_dir $deplibs"
3131 test -n "$add" && deplibs="$add $deplibs"
3132 if test "$hardcode_direct" != yes && \
3133 test "$hardcode_minus_L" != yes && \
3134 test "$hardcode_shlibpath_var" = yes; then
3135 case :$finalize_shlibpath: in
3136 *":$libdir:"*) ;;
3137 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
3138 esac
3143 if test "$linkmode" = prog || test "$mode" = relink; then
3144 add_shlibpath=
3145 add_dir=
3146 add=
3147 # Finalize command for both is simple: just hardcode it.
3148 if test "$hardcode_direct" = yes; then
3149 add="$libdir/$linklib"
3150 elif test "$hardcode_minus_L" = yes; then
3151 add_dir="-L$libdir"
3152 add="-l$name"
3153 elif test "$hardcode_shlibpath_var" = yes; then
3154 case :$finalize_shlibpath: in
3155 *":$libdir:"*) ;;
3156 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
3157 esac
3158 add="-l$name"
3159 elif test "$hardcode_automatic" = yes; then
3160 if test -n "$inst_prefix_dir" &&
3161 test -f "$inst_prefix_dir$libdir/$linklib" ; then
3162 add="$inst_prefix_dir$libdir/$linklib"
3163 else
3164 add="$libdir/$linklib"
3166 else
3167 # We cannot seem to hardcode it, guess we'll fake it.
3168 add_dir="-L$libdir"
3169 # Try looking first in the location we're being installed to.
3170 if test -n "$inst_prefix_dir"; then
3171 case $libdir in
3172 [\\/]*)
3173 add_dir="$add_dir -L$inst_prefix_dir$libdir"
3175 esac
3177 add="-l$name"
3180 if test "$linkmode" = prog; then
3181 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
3182 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
3183 else
3184 test -n "$add_dir" && deplibs="$add_dir $deplibs"
3185 test -n "$add" && deplibs="$add $deplibs"
3188 elif test "$linkmode" = prog; then
3189 # Here we assume that one of hardcode_direct or hardcode_minus_L
3190 # is not unsupported. This is valid on all known static and
3191 # shared platforms.
3192 if test "$hardcode_direct" != unsupported; then
3193 test -n "$old_library" && linklib="$old_library"
3194 compile_deplibs="$dir/$linklib $compile_deplibs"
3195 finalize_deplibs="$dir/$linklib $finalize_deplibs"
3196 else
3197 compile_deplibs="-l$name -L$dir $compile_deplibs"
3198 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
3200 elif test "$build_libtool_libs" = yes; then
3201 # Not a shared library
3202 if test "$deplibs_check_method" != pass_all; then
3203 # We're trying link a shared library against a static one
3204 # but the system doesn't support it.
3206 # Just print a warning and add the library to dependency_libs so
3207 # that the program can be linked against the static library.
3208 $echo
3209 $echo "*** Warning: This system can not link to static lib archive $lib."
3210 $echo "*** I have the capability to make that library automatically link in when"
3211 $echo "*** you link to this library. But I can only do this if you have a"
3212 $echo "*** shared version of the library, which you do not appear to have."
3213 if test "$module" = yes; then
3214 $echo "*** But as you try to build a module library, libtool will still create "
3215 $echo "*** a static module, that should work as long as the dlopening application"
3216 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
3217 if test -z "$global_symbol_pipe"; then
3218 $echo
3219 $echo "*** However, this would only work if libtool was able to extract symbol"
3220 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3221 $echo "*** not find such a program. So, this module is probably useless."
3222 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3224 if test "$build_old_libs" = no; then
3225 build_libtool_libs=module
3226 build_old_libs=yes
3227 else
3228 build_libtool_libs=no
3231 else
3232 deplibs="$dir/$old_library $deplibs"
3233 link_static=yes
3235 fi # link shared/static library?
3237 if test "$linkmode" = lib; then
3238 if test -n "$dependency_libs" &&
3239 { test "$hardcode_into_libs" != yes ||
3240 test "$build_old_libs" = yes ||
3241 test "$link_static" = yes; }; then
3242 # Extract -R from dependency_libs
3243 temp_deplibs=
3244 for libdir in $dependency_libs; do
3245 case $libdir in
3246 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
3247 case " $xrpath " in
3248 *" $temp_xrpath "*) ;;
3249 *) xrpath="$xrpath $temp_xrpath";;
3250 esac;;
3251 *) temp_deplibs="$temp_deplibs $libdir";;
3252 esac
3253 done
3254 dependency_libs="$temp_deplibs"
3257 newlib_search_path="$newlib_search_path $absdir"
3258 # Link against this library
3259 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
3260 # ... and its dependency_libs
3261 tmp_libs=
3262 for deplib in $dependency_libs; do
3263 newdependency_libs="$deplib $newdependency_libs"
3264 if test "X$duplicate_deps" = "Xyes" ; then
3265 case "$tmp_libs " in
3266 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
3267 esac
3269 tmp_libs="$tmp_libs $deplib"
3270 done
3272 if test "$link_all_deplibs" != no; then
3273 # Add the search paths of all dependency libraries
3274 for deplib in $dependency_libs; do
3275 case $deplib in
3276 -L*) path="$deplib" ;;
3277 *.la)
3278 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
3279 test "X$dir" = "X$deplib" && dir="."
3280 # We need an absolute path.
3281 case $dir in
3282 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
3284 absdir=`cd "$dir" && pwd`
3285 if test -z "$absdir"; then
3286 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
3287 absdir="$dir"
3290 esac
3291 if grep "^installed=no" $deplib > /dev/null; then
3292 path="$absdir/$objdir"
3293 else
3294 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3295 if test -z "$libdir"; then
3296 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3297 exit $EXIT_FAILURE
3299 if test "$absdir" != "$libdir"; then
3300 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
3302 path="$absdir"
3304 depdepl=
3305 case $host in
3306 *-*-darwin*)
3307 # we do not want to link against static libs,
3308 # but need to link against shared
3309 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
3310 if test -n "$deplibrary_names" ; then
3311 for tmp in $deplibrary_names ; do
3312 depdepl=$tmp
3313 done
3314 if test -f "$path/$depdepl" ; then
3315 depdepl="$path/$depdepl"
3317 # do not add paths which are already there
3318 case " $newlib_search_path " in
3319 *" $path "*) ;;
3320 *) newlib_search_path="$newlib_search_path $path";;
3321 esac
3323 path=""
3326 path="-L$path"
3328 esac
3330 -l*)
3331 case $host in
3332 *-*-darwin*)
3333 # Again, we only want to link against shared libraries
3334 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
3335 for tmp in $newlib_search_path ; do
3336 if test -f "$tmp/lib$tmp_libs.dylib" ; then
3337 eval depdepl="$tmp/lib$tmp_libs.dylib"
3338 break
3340 done
3341 path=""
3343 *) continue ;;
3344 esac
3346 *) continue ;;
3347 esac
3348 case " $deplibs " in
3349 *" $path "*) ;;
3350 *) deplibs="$path $deplibs" ;;
3351 esac
3352 case " $deplibs " in
3353 *" $depdepl "*) ;;
3354 *) deplibs="$depdepl $deplibs" ;;
3355 esac
3356 done
3357 fi # link_all_deplibs != no
3358 fi # linkmode = lib
3359 done # for deplib in $libs
3360 dependency_libs="$newdependency_libs"
3361 if test "$pass" = dlpreopen; then
3362 # Link the dlpreopened libraries before other libraries
3363 for deplib in $save_deplibs; do
3364 deplibs="$deplib $deplibs"
3365 done
3367 if test "$pass" != dlopen; then
3368 if test "$pass" != conv; then
3369 # Make sure lib_search_path contains only unique directories.
3370 lib_search_path=
3371 for dir in $newlib_search_path; do
3372 case "$lib_search_path " in
3373 *" $dir "*) ;;
3374 *) lib_search_path="$lib_search_path $dir" ;;
3375 esac
3376 done
3377 newlib_search_path=
3380 if test "$linkmode,$pass" != "prog,link"; then
3381 vars="deplibs"
3382 else
3383 vars="compile_deplibs finalize_deplibs"
3385 for var in $vars dependency_libs; do
3386 # Add libraries to $var in reverse order
3387 eval tmp_libs=\"\$$var\"
3388 new_libs=
3389 for deplib in $tmp_libs; do
3390 # FIXME: Pedantically, this is the right thing to do, so
3391 # that some nasty dependency loop isn't accidentally
3392 # broken:
3393 #new_libs="$deplib $new_libs"
3394 # Pragmatically, this seems to cause very few problems in
3395 # practice:
3396 case $deplib in
3397 -L*) new_libs="$deplib $new_libs" ;;
3398 -R*) ;;
3400 # And here is the reason: when a library appears more
3401 # than once as an explicit dependence of a library, or
3402 # is implicitly linked in more than once by the
3403 # compiler, it is considered special, and multiple
3404 # occurrences thereof are not removed. Compare this
3405 # with having the same library being listed as a
3406 # dependency of multiple other libraries: in this case,
3407 # we know (pedantically, we assume) the library does not
3408 # need to be listed more than once, so we keep only the
3409 # last copy. This is not always right, but it is rare
3410 # enough that we require users that really mean to play
3411 # such unportable linking tricks to link the library
3412 # using -Wl,-lname, so that libtool does not consider it
3413 # for duplicate removal.
3414 case " $specialdeplibs " in
3415 *" $deplib "*) new_libs="$deplib $new_libs" ;;
3417 case " $new_libs " in
3418 *" $deplib "*) ;;
3419 *) new_libs="$deplib $new_libs" ;;
3420 esac
3422 esac
3424 esac
3425 done
3426 tmp_libs=
3427 for deplib in $new_libs; do
3428 case $deplib in
3429 -L*)
3430 case " $tmp_libs " in
3431 *" $deplib "*) ;;
3432 *) tmp_libs="$tmp_libs $deplib" ;;
3433 esac
3435 *) tmp_libs="$tmp_libs $deplib" ;;
3436 esac
3437 done
3438 eval $var=\"$tmp_libs\"
3439 done # for var
3441 # Last step: remove runtime libs from dependency_libs
3442 # (they stay in deplibs)
3443 tmp_libs=
3444 for i in $dependency_libs ; do
3445 case " $predeps $postdeps $compiler_lib_search_path " in
3446 *" $i "*)
3447 i=""
3449 esac
3450 if test -n "$i" ; then
3451 tmp_libs="$tmp_libs $i"
3453 done
3454 dependency_libs=$tmp_libs
3455 done # for pass
3456 if test "$linkmode" = prog; then
3457 dlfiles="$newdlfiles"
3458 dlprefiles="$newdlprefiles"
3461 case $linkmode in
3462 oldlib)
3463 if test -n "$deplibs"; then
3464 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
3467 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3468 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3471 if test -n "$rpath"; then
3472 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3475 if test -n "$xrpath"; then
3476 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3479 if test -n "$vinfo"; then
3480 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3483 if test -n "$release"; then
3484 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3487 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3488 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3491 # Now set the variables for building old libraries.
3492 build_libtool_libs=no
3493 oldlibs="$output"
3494 objs="$objs$old_deplibs"
3497 lib)
3498 # Make sure we only generate libraries of the form `libNAME.la'.
3499 case $outputname in
3500 lib*)
3501 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3502 eval shared_ext=\"$shrext_cmds\"
3503 eval libname=\"$libname_spec\"
3506 if test "$module" = no; then
3507 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3508 $echo "$help" 1>&2
3509 exit $EXIT_FAILURE
3511 if test "$need_lib_prefix" != no; then
3512 # Add the "lib" prefix for modules if required
3513 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3514 eval shared_ext=\"$shrext_cmds\"
3515 eval libname=\"$libname_spec\"
3516 else
3517 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3520 esac
3522 if test -n "$objs"; then
3523 if test "$deplibs_check_method" != pass_all; then
3524 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3525 exit $EXIT_FAILURE
3526 else
3527 $echo
3528 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3529 $echo "*** objects $objs is not portable!"
3530 libobjs="$libobjs $objs"
3534 if test "$dlself" != no; then
3535 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3538 set dummy $rpath
3539 if test "$#" -gt 2; then
3540 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3542 install_libdir="$2"
3544 oldlibs=
3545 if test -z "$rpath"; then
3546 if test "$build_libtool_libs" = yes; then
3547 # Building a libtool convenience library.
3548 # Some compilers have problems with a `.al' extension so
3549 # convenience libraries should have the same extension an
3550 # archive normally would.
3551 oldlibs="$output_objdir/$libname.$libext $oldlibs"
3552 build_libtool_libs=convenience
3553 build_old_libs=yes
3556 if test -n "$vinfo"; then
3557 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3560 if test -n "$release"; then
3561 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3563 else
3565 # Parse the version information argument.
3566 save_ifs="$IFS"; IFS=':'
3567 set dummy $vinfo 0 0 0
3568 IFS="$save_ifs"
3570 if test -n "$8"; then
3571 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3572 $echo "$help" 1>&2
3573 exit $EXIT_FAILURE
3576 # convert absolute version numbers to libtool ages
3577 # this retains compatibility with .la files and attempts
3578 # to make the code below a bit more comprehensible
3580 case $vinfo_number in
3581 yes)
3582 number_major="$2"
3583 number_minor="$3"
3584 number_revision="$4"
3586 # There are really only two kinds -- those that
3587 # use the current revision as the major version
3588 # and those that subtract age and use age as
3589 # a minor version. But, then there is irix
3590 # which has an extra 1 added just for fun
3592 case $version_type in
3593 darwin|linux|osf|windows|none)
3594 current=`expr $number_major + $number_minor`
3595 age="$number_minor"
3596 revision="$number_revision"
3598 freebsd-aout|freebsd-elf|sunos)
3599 current="$number_major"
3600 revision="$number_minor"
3601 age="0"
3603 irix|nonstopux)
3604 current=`expr $number_major + $number_minor`
3605 age="$number_minor"
3606 revision="$number_minor"
3607 lt_irix_increment=no
3609 esac
3612 current="$2"
3613 revision="$3"
3614 age="$4"
3616 esac
3618 # Check that each of the things are valid numbers.
3619 case $current in
3620 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]) ;;
3622 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3623 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3624 exit $EXIT_FAILURE
3626 esac
3628 case $revision in
3629 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]) ;;
3631 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3632 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3633 exit $EXIT_FAILURE
3635 esac
3637 case $age in
3638 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]) ;;
3640 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3641 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3642 exit $EXIT_FAILURE
3644 esac
3646 if test "$age" -gt "$current"; then
3647 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3648 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3649 exit $EXIT_FAILURE
3652 # Calculate the version variables.
3653 major=
3654 versuffix=
3655 verstring=
3656 case $version_type in
3657 none) ;;
3659 darwin)
3660 # Like Linux, but with the current version available in
3661 # verstring for coding it into the library header
3662 major=.`expr $current - $age`
3663 versuffix="$major.$age.$revision"
3664 # Darwin ld doesn't like 0 for these options...
3665 minor_current=`expr $current + 1`
3666 xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3667 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
3670 freebsd-aout)
3671 major=".$current"
3672 versuffix=".$current.$revision";
3675 freebsd-elf)
3676 major=".$current"
3677 versuffix=".$current";
3680 irix | nonstopux)
3681 if test "X$lt_irix_increment" = "Xno"; then
3682 major=`expr $current - $age`
3683 else
3684 major=`expr $current - $age + 1`
3686 case $version_type in
3687 nonstopux) verstring_prefix=nonstopux ;;
3688 *) verstring_prefix=sgi ;;
3689 esac
3690 verstring="$verstring_prefix$major.$revision"
3692 # Add in all the interfaces that we are compatible with.
3693 loop=$revision
3694 while test "$loop" -ne 0; do
3695 iface=`expr $revision - $loop`
3696 loop=`expr $loop - 1`
3697 verstring="$verstring_prefix$major.$iface:$verstring"
3698 done
3700 # Before this point, $major must not contain `.'.
3701 major=.$major
3702 versuffix="$major.$revision"
3705 linux)
3706 major=.`expr $current - $age`
3707 versuffix="$major.$age.$revision"
3710 osf)
3711 major=.`expr $current - $age`
3712 versuffix=".$current.$age.$revision"
3713 verstring="$current.$age.$revision"
3715 # Add in all the interfaces that we are compatible with.
3716 loop=$age
3717 while test "$loop" -ne 0; do
3718 iface=`expr $current - $loop`
3719 loop=`expr $loop - 1`
3720 verstring="$verstring:${iface}.0"
3721 done
3723 # Make executables depend on our current version.
3724 verstring="$verstring:${current}.0"
3727 sunos)
3728 major=".$current"
3729 versuffix=".$current.$revision"
3732 windows)
3733 # Use '-' rather than '.', since we only want one
3734 # extension on DOS 8.3 filesystems.
3735 major=`expr $current - $age`
3736 versuffix="-$major"
3740 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3741 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3742 exit $EXIT_FAILURE
3744 esac
3746 # Clear the version info if we defaulted, and they specified a release.
3747 if test -z "$vinfo" && test -n "$release"; then
3748 major=
3749 case $version_type in
3750 darwin)
3751 # we can't check for "0.0" in archive_cmds due to quoting
3752 # problems, so we reset it completely
3753 verstring=
3756 verstring="0.0"
3758 esac
3759 if test "$need_version" = no; then
3760 versuffix=
3761 else
3762 versuffix=".0.0"
3766 # Remove version info from name if versioning should be avoided
3767 if test "$avoid_version" = yes && test "$need_version" = no; then
3768 major=
3769 versuffix=
3770 verstring=""
3773 # Check to see if the archive will have undefined symbols.
3774 if test "$allow_undefined" = yes; then
3775 if test "$allow_undefined_flag" = unsupported; then
3776 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3777 build_libtool_libs=no
3778 build_old_libs=yes
3780 else
3781 # Don't allow undefined symbols.
3782 allow_undefined_flag="$no_undefined_flag"
3786 if test "$mode" != relink; then
3787 # Remove our outputs, but don't remove object files since they
3788 # may have been created when compiling PIC objects.
3789 removelist=
3790 tempremovelist=`$echo "$output_objdir/*"`
3791 for p in $tempremovelist; do
3792 case $p in
3793 *.$objext)
3795 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3796 if test "X$precious_files_regex" != "X"; then
3797 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3798 then
3799 continue
3802 removelist="$removelist $p"
3804 *) ;;
3805 esac
3806 done
3807 if test -n "$removelist"; then
3808 $show "${rm}r $removelist"
3809 $run ${rm}r $removelist
3813 # Now set the variables for building old libraries.
3814 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3815 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3817 # Transform .lo files to .o files.
3818 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3821 # Eliminate all temporary directories.
3822 #for path in $notinst_path; do
3823 # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
3824 # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
3825 # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
3826 #done
3828 if test -n "$xrpath"; then
3829 # If the user specified any rpath flags, then add them.
3830 temp_xrpath=
3831 for libdir in $xrpath; do
3832 temp_xrpath="$temp_xrpath -R$libdir"
3833 case "$finalize_rpath " in
3834 *" $libdir "*) ;;
3835 *) finalize_rpath="$finalize_rpath $libdir" ;;
3836 esac
3837 done
3838 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3839 dependency_libs="$temp_xrpath $dependency_libs"
3843 # Make sure dlfiles contains only unique files that won't be dlpreopened
3844 old_dlfiles="$dlfiles"
3845 dlfiles=
3846 for lib in $old_dlfiles; do
3847 case " $dlprefiles $dlfiles " in
3848 *" $lib "*) ;;
3849 *) dlfiles="$dlfiles $lib" ;;
3850 esac
3851 done
3853 # Make sure dlprefiles contains only unique files
3854 old_dlprefiles="$dlprefiles"
3855 dlprefiles=
3856 for lib in $old_dlprefiles; do
3857 case "$dlprefiles " in
3858 *" $lib "*) ;;
3859 *) dlprefiles="$dlprefiles $lib" ;;
3860 esac
3861 done
3863 if test "$build_libtool_libs" = yes; then
3864 if test -n "$rpath"; then
3865 case $host in
3866 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3867 # these systems don't actually have a c library (as such)!
3869 *-*-rhapsody* | *-*-darwin1.[012])
3870 # Rhapsody C library is in the System framework
3871 deplibs="$deplibs -framework System"
3873 *-*-netbsd*)
3874 # Don't link with libc until the a.out ld.so is fixed.
3876 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3877 # Do not include libc due to us having libc/libc_r.
3879 *-*-sco3.2v5* | *-*-sco5v6*)
3880 # Causes problems with __ctype
3882 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
3883 # Compiler inserts libc in the correct place for threads to work
3886 # Add libc to deplibs on all other systems if necessary.
3887 if test "$build_libtool_need_lc" = "yes"; then
3888 deplibs="$deplibs -lc"
3891 esac
3894 # Transform deplibs into only deplibs that can be linked in shared.
3895 name_save=$name
3896 libname_save=$libname
3897 release_save=$release
3898 versuffix_save=$versuffix
3899 major_save=$major
3900 # I'm not sure if I'm treating the release correctly. I think
3901 # release should show up in the -l (ie -lgmp5) so we don't want to
3902 # add it in twice. Is that correct?
3903 release=""
3904 versuffix=""
3905 major=""
3906 newdeplibs=
3907 droppeddeps=no
3908 case $deplibs_check_method in
3909 pass_all)
3910 # Don't check for shared/static. Everything works.
3911 # This might be a little naive. We might want to check
3912 # whether the library exists or not. But this is on
3913 # osf3 & osf4 and I'm not really sure... Just
3914 # implementing what was already the behavior.
3915 newdeplibs=$deplibs
3917 test_compile)
3918 # This code stresses the "libraries are programs" paradigm to its
3919 # limits. Maybe even breaks it. We compile a program, linking it
3920 # against the deplibs as a proxy for the library. Then we can check
3921 # whether they linked in statically or dynamically with ldd.
3922 $rm conftest.c
3923 cat > conftest.c <<EOF
3924 int main() { return 0; }
3926 $rm conftest
3927 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
3928 ldd_output=`ldd conftest`
3929 for i in $deplibs; do
3930 name=`expr $i : '-l\(.*\)'`
3931 # If $name is empty we are operating on a -L argument.
3932 if test "$name" != "" && test "$name" != "0"; then
3933 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3934 case " $predeps $postdeps " in
3935 *" $i "*)
3936 newdeplibs="$newdeplibs $i"
3937 i=""
3939 esac
3941 if test -n "$i" ; then
3942 libname=`eval \\$echo \"$libname_spec\"`
3943 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3944 set dummy $deplib_matches
3945 deplib_match=$2
3946 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3947 newdeplibs="$newdeplibs $i"
3948 else
3949 droppeddeps=yes
3950 $echo
3951 $echo "*** Warning: dynamic linker does not accept needed library $i."
3952 $echo "*** I have the capability to make that library automatically link in when"
3953 $echo "*** you link to this library. But I can only do this if you have a"
3954 $echo "*** shared version of the library, which I believe you do not have"
3955 $echo "*** because a test_compile did reveal that the linker did not use it for"
3956 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3959 else
3960 newdeplibs="$newdeplibs $i"
3962 done
3963 else
3964 # Error occurred in the first compile. Let's try to salvage
3965 # the situation: Compile a separate program for each library.
3966 for i in $deplibs; do
3967 name=`expr $i : '-l\(.*\)'`
3968 # If $name is empty we are operating on a -L argument.
3969 if test "$name" != "" && test "$name" != "0"; then
3970 $rm conftest
3971 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
3972 ldd_output=`ldd conftest`
3973 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3974 case " $predeps $postdeps " in
3975 *" $i "*)
3976 newdeplibs="$newdeplibs $i"
3977 i=""
3979 esac
3981 if test -n "$i" ; then
3982 libname=`eval \\$echo \"$libname_spec\"`
3983 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3984 set dummy $deplib_matches
3985 deplib_match=$2
3986 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3987 newdeplibs="$newdeplibs $i"
3988 else
3989 droppeddeps=yes
3990 $echo
3991 $echo "*** Warning: dynamic linker does not accept needed library $i."
3992 $echo "*** I have the capability to make that library automatically link in when"
3993 $echo "*** you link to this library. But I can only do this if you have a"
3994 $echo "*** shared version of the library, which you do not appear to have"
3995 $echo "*** because a test_compile did reveal that the linker did not use this one"
3996 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3999 else
4000 droppeddeps=yes
4001 $echo
4002 $echo "*** Warning! Library $i is needed by this library but I was not able to"
4003 $echo "*** make it link in! You will probably need to install it or some"
4004 $echo "*** library that it depends on before this library will be fully"
4005 $echo "*** functional. Installing it before continuing would be even better."
4007 else
4008 newdeplibs="$newdeplibs $i"
4010 done
4013 file_magic*)
4014 set dummy $deplibs_check_method
4015 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
4016 for a_deplib in $deplibs; do
4017 name=`expr $a_deplib : '-l\(.*\)'`
4018 # If $name is empty we are operating on a -L argument.
4019 if test "$name" != "" && test "$name" != "0"; then
4020 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4021 case " $predeps $postdeps " in
4022 *" $a_deplib "*)
4023 newdeplibs="$newdeplibs $a_deplib"
4024 a_deplib=""
4026 esac
4028 if test -n "$a_deplib" ; then
4029 libname=`eval \\$echo \"$libname_spec\"`
4030 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
4031 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
4032 for potent_lib in $potential_libs; do
4033 # Follow soft links.
4034 if ls -lLd "$potent_lib" 2>/dev/null \
4035 | grep " -> " >/dev/null; then
4036 continue
4038 # The statement above tries to avoid entering an
4039 # endless loop below, in case of cyclic links.
4040 # We might still enter an endless loop, since a link
4041 # loop can be closed while we follow links,
4042 # but so what?
4043 potlib="$potent_lib"
4044 while test -h "$potlib" 2>/dev/null; do
4045 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
4046 case $potliblink in
4047 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
4048 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
4049 esac
4050 done
4051 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
4052 | ${SED} 10q \
4053 | $EGREP "$file_magic_regex" > /dev/null; then
4054 newdeplibs="$newdeplibs $a_deplib"
4055 a_deplib=""
4056 break 2
4058 done
4059 done
4061 if test -n "$a_deplib" ; then
4062 droppeddeps=yes
4063 $echo
4064 $echo "*** Warning: linker path does not have real file for library $a_deplib."
4065 $echo "*** I have the capability to make that library automatically link in when"
4066 $echo "*** you link to this library. But I can only do this if you have a"
4067 $echo "*** shared version of the library, which you do not appear to have"
4068 $echo "*** because I did check the linker path looking for a file starting"
4069 if test -z "$potlib" ; then
4070 $echo "*** with $libname but no candidates were found. (...for file magic test)"
4071 else
4072 $echo "*** with $libname and none of the candidates passed a file format test"
4073 $echo "*** using a file magic. Last file checked: $potlib"
4076 else
4077 # Add a -L argument.
4078 newdeplibs="$newdeplibs $a_deplib"
4080 done # Gone through all deplibs.
4082 match_pattern*)
4083 set dummy $deplibs_check_method
4084 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
4085 for a_deplib in $deplibs; do
4086 name=`expr $a_deplib : '-l\(.*\)'`
4087 # If $name is empty we are operating on a -L argument.
4088 if test -n "$name" && test "$name" != "0"; then
4089 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4090 case " $predeps $postdeps " in
4091 *" $a_deplib "*)
4092 newdeplibs="$newdeplibs $a_deplib"
4093 a_deplib=""
4095 esac
4097 if test -n "$a_deplib" ; then
4098 libname=`eval \\$echo \"$libname_spec\"`
4099 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
4100 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
4101 for potent_lib in $potential_libs; do
4102 potlib="$potent_lib" # see symlink-check above in file_magic test
4103 if eval $echo \"$potent_lib\" 2>/dev/null \
4104 | ${SED} 10q \
4105 | $EGREP "$match_pattern_regex" > /dev/null; then
4106 newdeplibs="$newdeplibs $a_deplib"
4107 a_deplib=""
4108 break 2
4110 done
4111 done
4113 if test -n "$a_deplib" ; then
4114 droppeddeps=yes
4115 $echo
4116 $echo "*** Warning: linker path does not have real file for library $a_deplib."
4117 $echo "*** I have the capability to make that library automatically link in when"
4118 $echo "*** you link to this library. But I can only do this if you have a"
4119 $echo "*** shared version of the library, which you do not appear to have"
4120 $echo "*** because I did check the linker path looking for a file starting"
4121 if test -z "$potlib" ; then
4122 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
4123 else
4124 $echo "*** with $libname and none of the candidates passed a file format test"
4125 $echo "*** using a regex pattern. Last file checked: $potlib"
4128 else
4129 # Add a -L argument.
4130 newdeplibs="$newdeplibs $a_deplib"
4132 done # Gone through all deplibs.
4134 none | unknown | *)
4135 newdeplibs=""
4136 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
4137 -e 's/ -[LR][^ ]*//g'`
4138 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4139 for i in $predeps $postdeps ; do
4140 # can't use Xsed below, because $i might contain '/'
4141 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
4142 done
4144 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
4145 | grep . >/dev/null; then
4146 $echo
4147 if test "X$deplibs_check_method" = "Xnone"; then
4148 $echo "*** Warning: inter-library dependencies are not supported in this platform."
4149 else
4150 $echo "*** Warning: inter-library dependencies are not known to be supported."
4152 $echo "*** All declared inter-library dependencies are being dropped."
4153 droppeddeps=yes
4156 esac
4157 versuffix=$versuffix_save
4158 major=$major_save
4159 release=$release_save
4160 libname=$libname_save
4161 name=$name_save
4163 case $host in
4164 *-*-rhapsody* | *-*-darwin1.[012])
4165 # On Rhapsody replace the C library is the System framework
4166 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
4168 esac
4170 if test "$droppeddeps" = yes; then
4171 if test "$module" = yes; then
4172 $echo
4173 $echo "*** Warning: libtool could not satisfy all declared inter-library"
4174 $echo "*** dependencies of module $libname. Therefore, libtool will create"
4175 $echo "*** a static module, that should work as long as the dlopening"
4176 $echo "*** application is linked with the -dlopen flag."
4177 if test -z "$global_symbol_pipe"; then
4178 $echo
4179 $echo "*** However, this would only work if libtool was able to extract symbol"
4180 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
4181 $echo "*** not find such a program. So, this module is probably useless."
4182 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
4184 if test "$build_old_libs" = no; then
4185 oldlibs="$output_objdir/$libname.$libext"
4186 build_libtool_libs=module
4187 build_old_libs=yes
4188 else
4189 build_libtool_libs=no
4191 else
4192 $echo "*** The inter-library dependencies that have been dropped here will be"
4193 $echo "*** automatically added whenever a program is linked with this library"
4194 $echo "*** or is declared to -dlopen it."
4196 if test "$allow_undefined" = no; then
4197 $echo
4198 $echo "*** Since this library must not contain undefined symbols,"
4199 $echo "*** because either the platform does not support them or"
4200 $echo "*** it was explicitly requested with -no-undefined,"
4201 $echo "*** libtool will only create a static version of it."
4202 if test "$build_old_libs" = no; then
4203 oldlibs="$output_objdir/$libname.$libext"
4204 build_libtool_libs=module
4205 build_old_libs=yes
4206 else
4207 build_libtool_libs=no
4212 # Done checking deplibs!
4213 deplibs=$newdeplibs
4217 # move library search paths that coincide with paths to not yet
4218 # installed libraries to the beginning of the library search list
4219 new_libs=
4220 for path in $notinst_path; do
4221 case " $new_libs " in
4222 *" -L$path/$objdir "*) ;;
4224 case " $deplibs " in
4225 *" -L$path/$objdir "*)
4226 new_libs="$new_libs -L$path/$objdir" ;;
4227 esac
4229 esac
4230 done
4231 for deplib in $deplibs; do
4232 case $deplib in
4233 -L*)
4234 case " $new_libs " in
4235 *" $deplib "*) ;;
4236 *) new_libs="$new_libs $deplib" ;;
4237 esac
4239 *) new_libs="$new_libs $deplib" ;;
4240 esac
4241 done
4242 deplibs="$new_libs"
4245 # All the library-specific variables (install_libdir is set above).
4246 library_names=
4247 old_library=
4248 dlname=
4250 # Test again, we may have decided not to build it any more
4251 if test "$build_libtool_libs" = yes; then
4252 if test "$hardcode_into_libs" = yes; then
4253 # Hardcode the library paths
4254 hardcode_libdirs=
4255 dep_rpath=
4256 rpath="$finalize_rpath"
4257 test "$mode" != relink && rpath="$compile_rpath$rpath"
4258 for libdir in $rpath; do
4259 if test -n "$hardcode_libdir_flag_spec"; then
4260 if test -n "$hardcode_libdir_separator"; then
4261 if test -z "$hardcode_libdirs"; then
4262 hardcode_libdirs="$libdir"
4263 else
4264 # Just accumulate the unique libdirs.
4265 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4266 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4269 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4271 esac
4273 else
4274 eval flag=\"$hardcode_libdir_flag_spec\"
4275 dep_rpath="$dep_rpath $flag"
4277 elif test -n "$runpath_var"; then
4278 case "$perm_rpath " in
4279 *" $libdir "*) ;;
4280 *) perm_rpath="$perm_rpath $libdir" ;;
4281 esac
4283 done
4284 # Substitute the hardcoded libdirs into the rpath.
4285 if test -n "$hardcode_libdir_separator" &&
4286 test -n "$hardcode_libdirs"; then
4287 libdir="$hardcode_libdirs"
4288 if test -n "$hardcode_libdir_flag_spec_ld"; then
4289 case $archive_cmds in
4290 *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;;
4291 *) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;;
4292 esac
4293 else
4294 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
4297 if test -n "$runpath_var" && test -n "$perm_rpath"; then
4298 # We should set the runpath_var.
4299 rpath=
4300 for dir in $perm_rpath; do
4301 rpath="$rpath$dir:"
4302 done
4303 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
4305 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
4308 shlibpath="$finalize_shlibpath"
4309 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
4310 if test -n "$shlibpath"; then
4311 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
4314 # Get the real and link names of the library.
4315 eval shared_ext=\"$shrext_cmds\"
4316 eval library_names=\"$library_names_spec\"
4317 set dummy $library_names
4318 realname="$2"
4319 shift; shift
4321 if test -n "$soname_spec"; then
4322 eval soname=\"$soname_spec\"
4323 else
4324 soname="$realname"
4326 if test -z "$dlname"; then
4327 dlname=$soname
4330 lib="$output_objdir/$realname"
4331 linknames=
4332 for link
4334 linknames="$linknames $link"
4335 done
4337 # Use standard objects if they are pic
4338 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4340 # Prepare the list of exported symbols
4341 if test -z "$export_symbols"; then
4342 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
4343 $show "generating symbol list for \`$libname.la'"
4344 export_symbols="$output_objdir/$libname.exp"
4345 $run $rm $export_symbols
4346 cmds=$export_symbols_cmds
4347 save_ifs="$IFS"; IFS='~'
4348 for cmd in $cmds; do
4349 IFS="$save_ifs"
4350 eval cmd=\"$cmd\"
4351 if len=`expr "X$cmd" : ".*"` &&
4352 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4353 $show "$cmd"
4354 $run eval "$cmd" || exit $?
4355 skipped_export=false
4356 else
4357 # The command line is too long to execute in one step.
4358 $show "using reloadable object file for export list..."
4359 skipped_export=:
4360 # Break out early, otherwise skipped_export may be
4361 # set to false by a later but shorter cmd.
4362 break
4364 done
4365 IFS="$save_ifs"
4366 if test -n "$export_symbols_regex"; then
4367 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
4368 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
4369 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
4370 $run eval '$mv "${export_symbols}T" "$export_symbols"'
4375 if test -n "$export_symbols" && test -n "$include_expsyms"; then
4376 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
4379 tmp_deplibs=
4380 for test_deplib in $deplibs; do
4381 case " $convenience " in
4382 *" $test_deplib "*) ;;
4384 tmp_deplibs="$tmp_deplibs $test_deplib"
4386 esac
4387 done
4388 deplibs="$tmp_deplibs"
4390 if test -n "$convenience"; then
4391 if test -n "$whole_archive_flag_spec"; then
4392 save_libobjs=$libobjs
4393 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4394 else
4395 gentop="$output_objdir/${outputname}x"
4396 generated="$generated $gentop"
4398 func_extract_archives $gentop $convenience
4399 libobjs="$libobjs $func_extract_archives_result"
4403 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
4404 eval flag=\"$thread_safe_flag_spec\"
4405 linker_flags="$linker_flags $flag"
4408 # Make a backup of the uninstalled library when relinking
4409 if test "$mode" = relink; then
4410 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
4413 # Do each of the archive commands.
4414 if test "$module" = yes && test -n "$module_cmds" ; then
4415 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4416 eval test_cmds=\"$module_expsym_cmds\"
4417 cmds=$module_expsym_cmds
4418 else
4419 eval test_cmds=\"$module_cmds\"
4420 cmds=$module_cmds
4422 else
4423 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4424 eval test_cmds=\"$archive_expsym_cmds\"
4425 cmds=$archive_expsym_cmds
4426 else
4427 eval test_cmds=\"$archive_cmds\"
4428 cmds=$archive_cmds
4432 if test "X$skipped_export" != "X:" &&
4433 len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4434 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4436 else
4437 # The command line is too long to link in one step, link piecewise.
4438 $echo "creating reloadable object files..."
4440 # Save the value of $output and $libobjs because we want to
4441 # use them later. If we have whole_archive_flag_spec, we
4442 # want to use save_libobjs as it was before
4443 # whole_archive_flag_spec was expanded, because we can't
4444 # assume the linker understands whole_archive_flag_spec.
4445 # This may have to be revisited, in case too many
4446 # convenience libraries get linked in and end up exceeding
4447 # the spec.
4448 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
4449 save_libobjs=$libobjs
4451 save_output=$output
4452 output_la=`$echo "X$output" | $Xsed -e "$basename"`
4454 # Clear the reloadable object creation command queue and
4455 # initialize k to one.
4456 test_cmds=
4457 concat_cmds=
4458 objlist=
4459 delfiles=
4460 last_robj=
4462 output=$output_objdir/$output_la-${k}.$objext
4463 # Loop over the list of objects to be linked.
4464 for obj in $save_libobjs
4466 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
4467 if test "X$objlist" = X ||
4468 { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4469 test "$len" -le "$max_cmd_len"; }; then
4470 objlist="$objlist $obj"
4471 else
4472 # The command $test_cmds is almost too long, add a
4473 # command to the queue.
4474 if test "$k" -eq 1 ; then
4475 # The first file doesn't have a previous command to add.
4476 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
4477 else
4478 # All subsequent reloadable object files will link in
4479 # the last one created.
4480 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
4482 last_robj=$output_objdir/$output_la-${k}.$objext
4483 k=`expr $k + 1`
4484 output=$output_objdir/$output_la-${k}.$objext
4485 objlist=$obj
4486 len=1
4488 done
4489 # Handle the remaining objects by creating one last
4490 # reloadable object file. All subsequent reloadable object
4491 # files will link in the last one created.
4492 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4493 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
4495 if ${skipped_export-false}; then
4496 $show "generating symbol list for \`$libname.la'"
4497 export_symbols="$output_objdir/$libname.exp"
4498 $run $rm $export_symbols
4499 libobjs=$output
4500 # Append the command to create the export file.
4501 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
4504 # Set up a command to remove the reloadable object files
4505 # after they are used.
4507 while test "$i" -lt "$k"
4509 i=`expr $i + 1`
4510 delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
4511 done
4513 $echo "creating a temporary reloadable object file: $output"
4515 # Loop through the commands generated above and execute them.
4516 save_ifs="$IFS"; IFS='~'
4517 for cmd in $concat_cmds; do
4518 IFS="$save_ifs"
4519 $show "$cmd"
4520 $run eval "$cmd" || exit $?
4521 done
4522 IFS="$save_ifs"
4524 libobjs=$output
4525 # Restore the value of output.
4526 output=$save_output
4528 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4529 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4531 # Expand the library linking commands again to reset the
4532 # value of $libobjs for piecewise linking.
4534 # Do each of the archive commands.
4535 if test "$module" = yes && test -n "$module_cmds" ; then
4536 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4537 cmds=$module_expsym_cmds
4538 else
4539 cmds=$module_cmds
4541 else
4542 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4543 cmds=$archive_expsym_cmds
4544 else
4545 cmds=$archive_cmds
4549 # Append the command to remove the reloadable object files
4550 # to the just-reset $cmds.
4551 eval cmds=\"\$cmds~\$rm $delfiles\"
4553 save_ifs="$IFS"; IFS='~'
4554 for cmd in $cmds; do
4555 IFS="$save_ifs"
4556 eval cmd=\"$cmd\"
4557 $show "$cmd"
4558 $run eval "$cmd" || {
4559 lt_exit=$?
4561 # Restore the uninstalled library and exit
4562 if test "$mode" = relink; then
4563 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
4566 exit $lt_exit
4568 done
4569 IFS="$save_ifs"
4571 # Restore the uninstalled library and exit
4572 if test "$mode" = relink; then
4573 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4575 if test -n "$convenience"; then
4576 if test -z "$whole_archive_flag_spec"; then
4577 $show "${rm}r $gentop"
4578 $run ${rm}r "$gentop"
4582 exit $EXIT_SUCCESS
4585 # Create links to the real library.
4586 for linkname in $linknames; do
4587 if test "$realname" != "$linkname"; then
4588 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4589 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4591 done
4593 # If -module or -export-dynamic was specified, set the dlname.
4594 if test "$module" = yes || test "$export_dynamic" = yes; then
4595 # On all known operating systems, these are identical.
4596 dlname="$soname"
4601 obj)
4602 if test -n "$deplibs"; then
4603 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4606 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4607 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4610 if test -n "$rpath"; then
4611 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4614 if test -n "$xrpath"; then
4615 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4618 if test -n "$vinfo"; then
4619 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4622 if test -n "$release"; then
4623 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4626 case $output in
4627 *.lo)
4628 if test -n "$objs$old_deplibs"; then
4629 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4630 exit $EXIT_FAILURE
4632 libobj="$output"
4633 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4636 libobj=
4637 obj="$output"
4639 esac
4641 # Delete the old objects.
4642 $run $rm $obj $libobj
4644 # Objects from convenience libraries. This assumes
4645 # single-version convenience libraries. Whenever we create
4646 # different ones for PIC/non-PIC, this we'll have to duplicate
4647 # the extraction.
4648 reload_conv_objs=
4649 gentop=
4650 # reload_cmds runs $LD directly, so let us get rid of
4651 # -Wl from whole_archive_flag_spec and hope we can get by with
4652 # turning comma into space..
4655 if test -n "$convenience"; then
4656 if test -n "$whole_archive_flag_spec"; then
4657 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
4658 reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
4659 else
4660 gentop="$output_objdir/${obj}x"
4661 generated="$generated $gentop"
4663 func_extract_archives $gentop $convenience
4664 reload_conv_objs="$reload_objs $func_extract_archives_result"
4668 # Create the old-style object.
4669 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
4671 output="$obj"
4672 cmds=$reload_cmds
4673 save_ifs="$IFS"; IFS='~'
4674 for cmd in $cmds; do
4675 IFS="$save_ifs"
4676 eval cmd=\"$cmd\"
4677 $show "$cmd"
4678 $run eval "$cmd" || exit $?
4679 done
4680 IFS="$save_ifs"
4682 # Exit if we aren't doing a library object file.
4683 if test -z "$libobj"; then
4684 if test -n "$gentop"; then
4685 $show "${rm}r $gentop"
4686 $run ${rm}r $gentop
4689 exit $EXIT_SUCCESS
4692 if test "$build_libtool_libs" != yes; then
4693 if test -n "$gentop"; then
4694 $show "${rm}r $gentop"
4695 $run ${rm}r $gentop
4698 # Create an invalid libtool object if no PIC, so that we don't
4699 # accidentally link it into a program.
4700 # $show "echo timestamp > $libobj"
4701 # $run eval "echo timestamp > $libobj" || exit $?
4702 exit $EXIT_SUCCESS
4705 if test -n "$pic_flag" || test "$pic_mode" != default; then
4706 # Only do commands if we really have different PIC objects.
4707 reload_objs="$libobjs $reload_conv_objs"
4708 output="$libobj"
4709 cmds=$reload_cmds
4710 save_ifs="$IFS"; IFS='~'
4711 for cmd in $cmds; do
4712 IFS="$save_ifs"
4713 eval cmd=\"$cmd\"
4714 $show "$cmd"
4715 $run eval "$cmd" || exit $?
4716 done
4717 IFS="$save_ifs"
4720 if test -n "$gentop"; then
4721 $show "${rm}r $gentop"
4722 $run ${rm}r $gentop
4725 exit $EXIT_SUCCESS
4728 prog)
4729 case $host in
4730 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4731 esac
4732 if test -n "$vinfo"; then
4733 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4736 if test -n "$release"; then
4737 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4740 if test "$preload" = yes; then
4741 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4742 test "$dlopen_self_static" = unknown; then
4743 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4747 case $host in
4748 *-*-rhapsody* | *-*-darwin1.[012])
4749 # On Rhapsody replace the C library is the System framework
4750 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4751 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4753 esac
4755 case $host in
4756 *darwin*)
4757 # Don't allow lazy linking, it breaks C++ global constructors
4758 if test "$tagname" = CXX ; then
4759 compile_command="$compile_command ${wl}-bind_at_load"
4760 finalize_command="$finalize_command ${wl}-bind_at_load"
4763 esac
4766 # move library search paths that coincide with paths to not yet
4767 # installed libraries to the beginning of the library search list
4768 new_libs=
4769 for path in $notinst_path; do
4770 case " $new_libs " in
4771 *" -L$path/$objdir "*) ;;
4773 case " $compile_deplibs " in
4774 *" -L$path/$objdir "*)
4775 new_libs="$new_libs -L$path/$objdir" ;;
4776 esac
4778 esac
4779 done
4780 for deplib in $compile_deplibs; do
4781 case $deplib in
4782 -L*)
4783 case " $new_libs " in
4784 *" $deplib "*) ;;
4785 *) new_libs="$new_libs $deplib" ;;
4786 esac
4788 *) new_libs="$new_libs $deplib" ;;
4789 esac
4790 done
4791 compile_deplibs="$new_libs"
4794 compile_command="$compile_command $compile_deplibs"
4795 finalize_command="$finalize_command $finalize_deplibs"
4797 if test -n "$rpath$xrpath"; then
4798 # If the user specified any rpath flags, then add them.
4799 for libdir in $rpath $xrpath; do
4800 # This is the magic to use -rpath.
4801 case "$finalize_rpath " in
4802 *" $libdir "*) ;;
4803 *) finalize_rpath="$finalize_rpath $libdir" ;;
4804 esac
4805 done
4808 # Now hardcode the library paths
4809 rpath=
4810 hardcode_libdirs=
4811 for libdir in $compile_rpath $finalize_rpath; do
4812 if test -n "$hardcode_libdir_flag_spec"; then
4813 if test -n "$hardcode_libdir_separator"; then
4814 if test -z "$hardcode_libdirs"; then
4815 hardcode_libdirs="$libdir"
4816 else
4817 # Just accumulate the unique libdirs.
4818 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4819 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4822 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4824 esac
4826 else
4827 eval flag=\"$hardcode_libdir_flag_spec\"
4828 rpath="$rpath $flag"
4830 elif test -n "$runpath_var"; then
4831 case "$perm_rpath " in
4832 *" $libdir "*) ;;
4833 *) perm_rpath="$perm_rpath $libdir" ;;
4834 esac
4836 case $host in
4837 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4838 testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
4839 case :$dllsearchpath: in
4840 *":$libdir:"*) ;;
4841 *) dllsearchpath="$dllsearchpath:$libdir";;
4842 esac
4843 case :$dllsearchpath: in
4844 *":$testbindir:"*) ;;
4845 *) dllsearchpath="$dllsearchpath:$testbindir";;
4846 esac
4848 esac
4849 done
4850 # Substitute the hardcoded libdirs into the rpath.
4851 if test -n "$hardcode_libdir_separator" &&
4852 test -n "$hardcode_libdirs"; then
4853 libdir="$hardcode_libdirs"
4854 eval rpath=\" $hardcode_libdir_flag_spec\"
4856 compile_rpath="$rpath"
4858 rpath=
4859 hardcode_libdirs=
4860 for libdir in $finalize_rpath; do
4861 if test -n "$hardcode_libdir_flag_spec"; then
4862 if test -n "$hardcode_libdir_separator"; then
4863 if test -z "$hardcode_libdirs"; then
4864 hardcode_libdirs="$libdir"
4865 else
4866 # Just accumulate the unique libdirs.
4867 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4868 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4871 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4873 esac
4875 else
4876 eval flag=\"$hardcode_libdir_flag_spec\"
4877 rpath="$rpath $flag"
4879 elif test -n "$runpath_var"; then
4880 case "$finalize_perm_rpath " in
4881 *" $libdir "*) ;;
4882 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4883 esac
4885 done
4886 # Substitute the hardcoded libdirs into the rpath.
4887 if test -n "$hardcode_libdir_separator" &&
4888 test -n "$hardcode_libdirs"; then
4889 libdir="$hardcode_libdirs"
4890 eval rpath=\" $hardcode_libdir_flag_spec\"
4892 finalize_rpath="$rpath"
4894 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4895 # Transform all the library objects into standard objects.
4896 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4897 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4900 dlsyms=
4901 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4902 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4903 dlsyms="${outputname}S.c"
4904 else
4905 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4909 if test -n "$dlsyms"; then
4910 case $dlsyms in
4911 "") ;;
4912 *.c)
4913 # Discover the nlist of each of the dlfiles.
4914 nlist="$output_objdir/${outputname}.nm"
4916 $show "$rm $nlist ${nlist}S ${nlist}T"
4917 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4919 # Parse the name list into a source file.
4920 $show "creating $output_objdir/$dlsyms"
4922 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4923 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4924 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4926 #ifdef __cplusplus
4927 extern \"C\" {
4928 #endif
4930 /* Prevent the only kind of declaration conflicts we can make. */
4931 #define lt_preloaded_symbols some_other_symbol
4933 /* External symbol declarations for the compiler. */\
4936 if test "$dlself" = yes; then
4937 $show "generating symbol list for \`$output'"
4939 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4941 # Add our own program objects to the symbol list.
4942 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4943 for arg in $progfiles; do
4944 $show "extracting global C symbols from \`$arg'"
4945 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4946 done
4948 if test -n "$exclude_expsyms"; then
4949 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4950 $run eval '$mv "$nlist"T "$nlist"'
4953 if test -n "$export_symbols_regex"; then
4954 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4955 $run eval '$mv "$nlist"T "$nlist"'
4958 # Prepare the list of exported symbols
4959 if test -z "$export_symbols"; then
4960 export_symbols="$output_objdir/$outputname.exp"
4961 $run $rm $export_symbols
4962 $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4963 case $host in
4964 *cygwin* | *mingw* )
4965 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4966 $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4968 esac
4969 else
4970 $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4971 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4972 $run eval 'mv "$nlist"T "$nlist"'
4973 case $host in
4974 *cygwin* | *mingw* )
4975 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4976 $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
4978 esac
4982 for arg in $dlprefiles; do
4983 $show "extracting global C symbols from \`$arg'"
4984 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4985 $run eval '$echo ": $name " >> "$nlist"'
4986 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4987 done
4989 if test -z "$run"; then
4990 # Make sure we have at least an empty file.
4991 test -f "$nlist" || : > "$nlist"
4993 if test -n "$exclude_expsyms"; then
4994 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4995 $mv "$nlist"T "$nlist"
4998 # Try sorting and uniquifying the output.
4999 if grep -v "^: " < "$nlist" |
5000 if sort -k 3 </dev/null >/dev/null 2>&1; then
5001 sort -k 3
5002 else
5003 sort +2
5004 fi |
5005 uniq > "$nlist"S; then
5007 else
5008 grep -v "^: " < "$nlist" > "$nlist"S
5011 if test -f "$nlist"S; then
5012 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
5013 else
5014 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
5017 $echo >> "$output_objdir/$dlsyms" "\
5019 #undef lt_preloaded_symbols
5021 #if defined (__STDC__) && __STDC__
5022 # define lt_ptr void *
5023 #else
5024 # define lt_ptr char *
5025 # define const
5026 #endif
5028 /* The mapping between symbol names and symbols. */
5031 case $host in
5032 *cygwin* | *mingw* )
5033 $echo >> "$output_objdir/$dlsyms" "\
5034 /* DATA imports from DLLs on WIN32 can't be const, because
5035 runtime relocations are performed -- see ld's documentation
5036 on pseudo-relocs */
5037 struct {
5041 $echo >> "$output_objdir/$dlsyms" "\
5042 const struct {
5045 esac
5048 $echo >> "$output_objdir/$dlsyms" "\
5049 const char *name;
5050 lt_ptr address;
5052 lt_preloaded_symbols[] =
5056 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
5058 $echo >> "$output_objdir/$dlsyms" "\
5059 {0, (lt_ptr) 0}
5062 /* This works around a problem in FreeBSD linker */
5063 #ifdef FREEBSD_WORKAROUND
5064 static const void *lt_preloaded_setup() {
5065 return lt_preloaded_symbols;
5067 #endif
5069 #ifdef __cplusplus
5071 #endif\
5075 pic_flag_for_symtable=
5076 case $host in
5077 # compiling the symbol table file with pic_flag works around
5078 # a FreeBSD bug that causes programs to crash when -lm is
5079 # linked before any other PIC object. But we must not use
5080 # pic_flag when linking with -static. The problem exists in
5081 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
5082 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
5083 case "$compile_command " in
5084 *" -static "*) ;;
5085 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
5086 esac;;
5087 *-*-hpux*)
5088 case "$compile_command " in
5089 *" -static "*) ;;
5090 *) pic_flag_for_symtable=" $pic_flag";;
5091 esac
5092 esac
5094 # Now compile the dynamic symbol file.
5095 $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
5096 $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
5098 # Clean up the generated files.
5099 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
5100 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
5102 # Transform the symbol file into the correct name.
5103 case $host in
5104 *cygwin* | *mingw* )
5105 if test -f "$output_objdir/${outputname}.def" ; then
5106 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
5107 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
5108 else
5109 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
5110 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
5114 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
5115 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
5117 esac
5120 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
5121 exit $EXIT_FAILURE
5123 esac
5124 else
5125 # We keep going just in case the user didn't refer to
5126 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
5127 # really was required.
5129 # Nullify the symbol file.
5130 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
5131 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
5134 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
5135 # Replace the output file specification.
5136 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
5137 link_command="$compile_command$compile_rpath"
5139 # We have no uninstalled library dependencies, so finalize right now.
5140 $show "$link_command"
5141 $run eval "$link_command"
5142 exit_status=$?
5144 # Delete the generated files.
5145 if test -n "$dlsyms"; then
5146 $show "$rm $output_objdir/${outputname}S.${objext}"
5147 $run $rm "$output_objdir/${outputname}S.${objext}"
5150 exit $exit_status
5153 if test -n "$shlibpath_var"; then
5154 # We should set the shlibpath_var
5155 rpath=
5156 for dir in $temp_rpath; do
5157 case $dir in
5158 [\\/]* | [A-Za-z]:[\\/]*)
5159 # Absolute path.
5160 rpath="$rpath$dir:"
5163 # Relative path: add a thisdir entry.
5164 rpath="$rpath\$thisdir/$dir:"
5166 esac
5167 done
5168 temp_rpath="$rpath"
5171 if test -n "$compile_shlibpath$finalize_shlibpath"; then
5172 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
5174 if test -n "$finalize_shlibpath"; then
5175 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
5178 compile_var=
5179 finalize_var=
5180 if test -n "$runpath_var"; then
5181 if test -n "$perm_rpath"; then
5182 # We should set the runpath_var.
5183 rpath=
5184 for dir in $perm_rpath; do
5185 rpath="$rpath$dir:"
5186 done
5187 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
5189 if test -n "$finalize_perm_rpath"; then
5190 # We should set the runpath_var.
5191 rpath=
5192 for dir in $finalize_perm_rpath; do
5193 rpath="$rpath$dir:"
5194 done
5195 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
5199 if test "$no_install" = yes; then
5200 # We don't need to create a wrapper script.
5201 link_command="$compile_var$compile_command$compile_rpath"
5202 # Replace the output file specification.
5203 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
5204 # Delete the old output file.
5205 $run $rm $output
5206 # Link the executable and exit
5207 $show "$link_command"
5208 $run eval "$link_command" || exit $?
5209 exit $EXIT_SUCCESS
5212 if test "$hardcode_action" = relink; then
5213 # Fast installation is not supported
5214 link_command="$compile_var$compile_command$compile_rpath"
5215 relink_command="$finalize_var$finalize_command$finalize_rpath"
5217 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
5218 $echo "$modename: \`$output' will be relinked during installation" 1>&2
5219 else
5220 if test "$fast_install" != no; then
5221 link_command="$finalize_var$compile_command$finalize_rpath"
5222 if test "$fast_install" = yes; then
5223 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
5224 else
5225 # fast_install is set to needless
5226 relink_command=
5228 else
5229 link_command="$compile_var$compile_command$compile_rpath"
5230 relink_command="$finalize_var$finalize_command$finalize_rpath"
5234 # Replace the output file specification.
5235 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
5237 # Delete the old output files.
5238 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
5240 $show "$link_command"
5241 $run eval "$link_command" || exit $?
5243 # Now create the wrapper script.
5244 $show "creating $output"
5246 # Quote the relink command for shipping.
5247 if test -n "$relink_command"; then
5248 # Preserve any variables that may affect compiler behavior
5249 for var in $variables_saved_for_relink; do
5250 if eval test -z \"\${$var+set}\"; then
5251 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5252 elif eval var_value=\$$var; test -z "$var_value"; then
5253 relink_command="$var=; export $var; $relink_command"
5254 else
5255 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5256 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5258 done
5259 relink_command="(cd `pwd`; $relink_command)"
5260 relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
5263 # Quote $echo for shipping.
5264 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
5265 case $progpath in
5266 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
5267 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
5268 esac
5269 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
5270 else
5271 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
5274 # Only actually do things if our run command is non-null.
5275 if test -z "$run"; then
5276 # win32 will think the script is a binary if it has
5277 # a .exe suffix, so we strip it off here.
5278 case $output in
5279 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
5280 esac
5281 # test for cygwin because mv fails w/o .exe extensions
5282 case $host in
5283 *cygwin*)
5284 exeext=.exe
5285 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
5286 *) exeext= ;;
5287 esac
5288 case $host in
5289 *cygwin* | *mingw* )
5290 output_name=`basename $output`
5291 output_path=`dirname $output`
5292 cwrappersource="$output_path/$objdir/lt-$output_name.c"
5293 cwrapper="$output_path/$output_name.exe"
5294 $rm $cwrappersource $cwrapper
5295 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
5297 cat > $cwrappersource <<EOF
5299 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
5300 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5302 The $output program cannot be directly executed until all the libtool
5303 libraries that it depends on are installed.
5305 This wrapper executable should never be moved out of the build directory.
5306 If it is, it will not operate correctly.
5308 Currently, it simply execs the wrapper *script* "/bin/sh $output",
5309 but could eventually absorb all of the scripts functionality and
5310 exec $objdir/$outputname directly.
5313 cat >> $cwrappersource<<"EOF"
5314 #include <stdio.h>
5315 #include <stdlib.h>
5316 #include <unistd.h>
5317 #include <malloc.h>
5318 #include <stdarg.h>
5319 #include <assert.h>
5320 #include <string.h>
5321 #include <ctype.h>
5322 #include <sys/stat.h>
5324 #if defined(PATH_MAX)
5325 # define LT_PATHMAX PATH_MAX
5326 #elif defined(MAXPATHLEN)
5327 # define LT_PATHMAX MAXPATHLEN
5328 #else
5329 # define LT_PATHMAX 1024
5330 #endif
5332 #ifndef DIR_SEPARATOR
5333 # define DIR_SEPARATOR '/'
5334 # define PATH_SEPARATOR ':'
5335 #endif
5337 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
5338 defined (__OS2__)
5339 # define HAVE_DOS_BASED_FILE_SYSTEM
5340 # ifndef DIR_SEPARATOR_2
5341 # define DIR_SEPARATOR_2 '\\'
5342 # endif
5343 # ifndef PATH_SEPARATOR_2
5344 # define PATH_SEPARATOR_2 ';'
5345 # endif
5346 #endif
5348 #ifndef DIR_SEPARATOR_2
5349 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
5350 #else /* DIR_SEPARATOR_2 */
5351 # define IS_DIR_SEPARATOR(ch) \
5352 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
5353 #endif /* DIR_SEPARATOR_2 */
5355 #ifndef PATH_SEPARATOR_2
5356 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
5357 #else /* PATH_SEPARATOR_2 */
5358 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
5359 #endif /* PATH_SEPARATOR_2 */
5361 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
5362 #define XFREE(stale) do { \
5363 if (stale) { free ((void *) stale); stale = 0; } \
5364 } while (0)
5366 /* -DDEBUG is fairly common in CFLAGS. */
5367 #undef DEBUG
5368 #if defined DEBUGWRAPPER
5369 # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
5370 #else
5371 # define DEBUG(format, ...)
5372 #endif
5374 const char *program_name = NULL;
5376 void * xmalloc (size_t num);
5377 char * xstrdup (const char *string);
5378 const char * base_name (const char *name);
5379 char * find_executable(const char *wrapper);
5380 int check_executable(const char *path);
5381 char * strendzap(char *str, const char *pat);
5382 void lt_fatal (const char *message, ...);
5385 main (int argc, char *argv[])
5387 char **newargz;
5388 int i;
5390 program_name = (char *) xstrdup (base_name (argv[0]));
5391 DEBUG("(main) argv[0] : %s\n",argv[0]);
5392 DEBUG("(main) program_name : %s\n",program_name);
5393 newargz = XMALLOC(char *, argc+2);
5396 cat >> $cwrappersource <<EOF
5397 newargz[0] = (char *) xstrdup("$SHELL");
5400 cat >> $cwrappersource <<"EOF"
5401 newargz[1] = find_executable(argv[0]);
5402 if (newargz[1] == NULL)
5403 lt_fatal("Couldn't find %s", argv[0]);
5404 DEBUG("(main) found exe at : %s\n",newargz[1]);
5405 /* we know the script has the same name, without the .exe */
5406 /* so make sure newargz[1] doesn't end in .exe */
5407 strendzap(newargz[1],".exe");
5408 for (i = 1; i < argc; i++)
5409 newargz[i+1] = xstrdup(argv[i]);
5410 newargz[argc+1] = NULL;
5412 for (i=0; i<argc+1; i++)
5414 DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
5420 case $host_os in
5421 mingw*)
5422 cat >> $cwrappersource <<EOF
5423 execv("$SHELL",(char const **)newargz);
5427 cat >> $cwrappersource <<EOF
5428 execv("$SHELL",newargz);
5431 esac
5433 cat >> $cwrappersource <<"EOF"
5434 return 127;
5437 void *
5438 xmalloc (size_t num)
5440 void * p = (void *) malloc (num);
5441 if (!p)
5442 lt_fatal ("Memory exhausted");
5444 return p;
5447 char *
5448 xstrdup (const char *string)
5450 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5454 const char *
5455 base_name (const char *name)
5457 const char *base;
5459 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5460 /* Skip over the disk name in MSDOS pathnames. */
5461 if (isalpha ((unsigned char)name[0]) && name[1] == ':')
5462 name += 2;
5463 #endif
5465 for (base = name; *name; name++)
5466 if (IS_DIR_SEPARATOR (*name))
5467 base = name + 1;
5468 return base;
5472 check_executable(const char * path)
5474 struct stat st;
5476 DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
5477 if ((!path) || (!*path))
5478 return 0;
5480 if ((stat (path, &st) >= 0) &&
5482 /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
5483 #if defined (S_IXOTH)
5484 ((st.st_mode & S_IXOTH) == S_IXOTH) ||
5485 #endif
5486 #if defined (S_IXGRP)
5487 ((st.st_mode & S_IXGRP) == S_IXGRP) ||
5488 #endif
5489 ((st.st_mode & S_IXUSR) == S_IXUSR))
5491 return 1;
5492 else
5493 return 0;
5496 /* Searches for the full path of the wrapper. Returns
5497 newly allocated full path name if found, NULL otherwise */
5498 char *
5499 find_executable (const char* wrapper)
5501 int has_slash = 0;
5502 const char* p;
5503 const char* p_next;
5504 /* static buffer for getcwd */
5505 char tmp[LT_PATHMAX + 1];
5506 int tmp_len;
5507 char* concat_name;
5509 DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
5511 if ((wrapper == NULL) || (*wrapper == '\0'))
5512 return NULL;
5514 /* Absolute path? */
5515 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5516 if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
5518 concat_name = xstrdup (wrapper);
5519 if (check_executable(concat_name))
5520 return concat_name;
5521 XFREE(concat_name);
5523 else
5525 #endif
5526 if (IS_DIR_SEPARATOR (wrapper[0]))
5528 concat_name = xstrdup (wrapper);
5529 if (check_executable(concat_name))
5530 return concat_name;
5531 XFREE(concat_name);
5533 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5535 #endif
5537 for (p = wrapper; *p; p++)
5538 if (*p == '/')
5540 has_slash = 1;
5541 break;
5543 if (!has_slash)
5545 /* no slashes; search PATH */
5546 const char* path = getenv ("PATH");
5547 if (path != NULL)
5549 for (p = path; *p; p = p_next)
5551 const char* q;
5552 size_t p_len;
5553 for (q = p; *q; q++)
5554 if (IS_PATH_SEPARATOR(*q))
5555 break;
5556 p_len = q - p;
5557 p_next = (*q == '\0' ? q : q + 1);
5558 if (p_len == 0)
5560 /* empty path: current directory */
5561 if (getcwd (tmp, LT_PATHMAX) == NULL)
5562 lt_fatal ("getcwd failed");
5563 tmp_len = strlen(tmp);
5564 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5565 memcpy (concat_name, tmp, tmp_len);
5566 concat_name[tmp_len] = '/';
5567 strcpy (concat_name + tmp_len + 1, wrapper);
5569 else
5571 concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
5572 memcpy (concat_name, p, p_len);
5573 concat_name[p_len] = '/';
5574 strcpy (concat_name + p_len + 1, wrapper);
5576 if (check_executable(concat_name))
5577 return concat_name;
5578 XFREE(concat_name);
5581 /* not found in PATH; assume curdir */
5583 /* Relative path | not found in path: prepend cwd */
5584 if (getcwd (tmp, LT_PATHMAX) == NULL)
5585 lt_fatal ("getcwd failed");
5586 tmp_len = strlen(tmp);
5587 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5588 memcpy (concat_name, tmp, tmp_len);
5589 concat_name[tmp_len] = '/';
5590 strcpy (concat_name + tmp_len + 1, wrapper);
5592 if (check_executable(concat_name))
5593 return concat_name;
5594 XFREE(concat_name);
5595 return NULL;
5598 char *
5599 strendzap(char *str, const char *pat)
5601 size_t len, patlen;
5603 assert(str != NULL);
5604 assert(pat != NULL);
5606 len = strlen(str);
5607 patlen = strlen(pat);
5609 if (patlen <= len)
5611 str += len - patlen;
5612 if (strcmp(str, pat) == 0)
5613 *str = '\0';
5615 return str;
5618 static void
5619 lt_error_core (int exit_status, const char * mode,
5620 const char * message, va_list ap)
5622 fprintf (stderr, "%s: %s: ", program_name, mode);
5623 vfprintf (stderr, message, ap);
5624 fprintf (stderr, ".\n");
5626 if (exit_status >= 0)
5627 exit (exit_status);
5630 void
5631 lt_fatal (const char *message, ...)
5633 va_list ap;
5634 va_start (ap, message);
5635 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5636 va_end (ap);
5639 # we should really use a build-platform specific compiler
5640 # here, but OTOH, the wrappers (shell script and this C one)
5641 # are only useful if you want to execute the "real" binary.
5642 # Since the "real" binary is built for $host, then this
5643 # wrapper might as well be built for $host, too.
5644 $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
5646 esac
5647 $rm $output
5648 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5650 $echo > $output "\
5651 #! $SHELL
5653 # $output - temporary wrapper script for $objdir/$outputname
5654 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5656 # The $output program cannot be directly executed until all the libtool
5657 # libraries that it depends on are installed.
5659 # This wrapper script should never be moved out of the build directory.
5660 # If it is, it will not operate correctly.
5662 # Sed substitution that helps us do robust quoting. It backslashifies
5663 # metacharacters that are still active within double-quoted strings.
5664 Xsed='${SED} -e 1s/^X//'
5665 sed_quote_subst='$sed_quote_subst'
5667 # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
5668 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
5669 emulate sh
5670 NULLCMD=:
5671 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
5672 # is contrary to our usage. Disable this feature.
5673 alias -g '\${1+\"\$@\"}'='\"\$@\"'
5674 setopt NO_GLOB_SUBST
5675 else
5676 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
5678 BIN_SH=xpg4; export BIN_SH # for Tru64
5679 DUALCASE=1; export DUALCASE # for MKS sh
5681 # The HP-UX ksh and POSIX shell print the target directory to stdout
5682 # if CDPATH is set.
5683 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5685 relink_command=\"$relink_command\"
5687 # This environment variable determines our operation mode.
5688 if test \"\$libtool_install_magic\" = \"$magic\"; then
5689 # install mode needs the following variable:
5690 notinst_deplibs='$notinst_deplibs'
5691 else
5692 # When we are sourced in execute mode, \$file and \$echo are already set.
5693 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5694 echo=\"$qecho\"
5695 file=\"\$0\"
5696 # Make sure echo works.
5697 if test \"X\$1\" = X--no-reexec; then
5698 # Discard the --no-reexec flag, and continue.
5699 shift
5700 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
5701 # Yippee, \$echo works!
5703 else
5704 # Restart under the correct shell, and then maybe \$echo will work.
5705 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5709 $echo >> $output "\
5711 # Find the directory that this script lives in.
5712 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
5713 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5715 # Follow symbolic links until we get to the real thisdir.
5716 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
5717 while test -n \"\$file\"; do
5718 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
5720 # If there was a directory component, then change thisdir.
5721 if test \"x\$destdir\" != \"x\$file\"; then
5722 case \"\$destdir\" in
5723 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5724 *) thisdir=\"\$thisdir/\$destdir\" ;;
5725 esac
5728 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
5729 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
5730 done
5732 # Try to get the absolute directory name.
5733 absdir=\`cd \"\$thisdir\" && pwd\`
5734 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5737 if test "$fast_install" = yes; then
5738 $echo >> $output "\
5739 program=lt-'$outputname'$exeext
5740 progdir=\"\$thisdir/$objdir\"
5742 if test ! -f \"\$progdir/\$program\" || \\
5743 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5744 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5746 file=\"\$\$-\$program\"
5748 if test ! -d \"\$progdir\"; then
5749 $mkdir \"\$progdir\"
5750 else
5751 $rm \"\$progdir/\$file\"
5754 $echo >> $output "\
5756 # relink executable if necessary
5757 if test -n \"\$relink_command\"; then
5758 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5759 else
5760 $echo \"\$relink_command_output\" >&2
5761 $rm \"\$progdir/\$file\"
5762 exit $EXIT_FAILURE
5766 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5767 { $rm \"\$progdir/\$program\";
5768 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5769 $rm \"\$progdir/\$file\"
5771 else
5772 $echo >> $output "\
5773 program='$outputname'
5774 progdir=\"\$thisdir/$objdir\"
5778 $echo >> $output "\
5780 if test -f \"\$progdir/\$program\"; then"
5782 # Export our shlibpath_var if we have one.
5783 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5784 $echo >> $output "\
5785 # Add our own library path to $shlibpath_var
5786 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5788 # Some systems cannot cope with colon-terminated $shlibpath_var
5789 # The second colon is a workaround for a bug in BeOS R4 sed
5790 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5792 export $shlibpath_var
5796 # fixup the dll searchpath if we need to.
5797 if test -n "$dllsearchpath"; then
5798 $echo >> $output "\
5799 # Add the dll search path components to the executable PATH
5800 PATH=$dllsearchpath:\$PATH
5804 $echo >> $output "\
5805 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5806 # Run the actual program with our arguments.
5808 case $host in
5809 # Backslashes separate directories on plain windows
5810 *-*-mingw | *-*-os2*)
5811 $echo >> $output "\
5812 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5817 $echo >> $output "\
5818 exec \"\$progdir/\$program\" \${1+\"\$@\"}
5821 esac
5822 $echo >> $output "\
5823 \$echo \"\$0: cannot exec \$program \$*\"
5824 exit $EXIT_FAILURE
5826 else
5827 # The program doesn't exist.
5828 \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
5829 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5830 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5831 exit $EXIT_FAILURE
5835 chmod +x $output
5837 exit $EXIT_SUCCESS
5839 esac
5841 # See if we need to build an old-fashioned archive.
5842 for oldlib in $oldlibs; do
5844 if test "$build_libtool_libs" = convenience; then
5845 oldobjs="$libobjs_save"
5846 addlibs="$convenience"
5847 build_libtool_libs=no
5848 else
5849 if test "$build_libtool_libs" = module; then
5850 oldobjs="$libobjs_save"
5851 build_libtool_libs=no
5852 else
5853 oldobjs="$old_deplibs $non_pic_objects"
5855 addlibs="$old_convenience"
5858 if test -n "$addlibs"; then
5859 gentop="$output_objdir/${outputname}x"
5860 generated="$generated $gentop"
5862 func_extract_archives $gentop $addlibs
5863 oldobjs="$oldobjs $func_extract_archives_result"
5866 # Do each command in the archive commands.
5867 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5868 cmds=$old_archive_from_new_cmds
5869 else
5870 # POSIX demands no paths to be encoded in archives. We have
5871 # to avoid creating archives with duplicate basenames if we
5872 # might have to extract them afterwards, e.g., when creating a
5873 # static archive out of a convenience library, or when linking
5874 # the entirety of a libtool archive into another (currently
5875 # not supported by libtool).
5876 if (for obj in $oldobjs
5878 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5879 done | sort | sort -uc >/dev/null 2>&1); then
5881 else
5882 $echo "copying selected object files to avoid basename conflicts..."
5884 if test -z "$gentop"; then
5885 gentop="$output_objdir/${outputname}x"
5886 generated="$generated $gentop"
5888 $show "${rm}r $gentop"
5889 $run ${rm}r "$gentop"
5890 $show "$mkdir $gentop"
5891 $run $mkdir "$gentop"
5892 exit_status=$?
5893 if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
5894 exit $exit_status
5898 save_oldobjs=$oldobjs
5899 oldobjs=
5900 counter=1
5901 for obj in $save_oldobjs
5903 objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
5904 case " $oldobjs " in
5905 " ") oldobjs=$obj ;;
5906 *[\ /]"$objbase "*)
5907 while :; do
5908 # Make sure we don't pick an alternate name that also
5909 # overlaps.
5910 newobj=lt$counter-$objbase
5911 counter=`expr $counter + 1`
5912 case " $oldobjs " in
5913 *[\ /]"$newobj "*) ;;
5914 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
5915 esac
5916 done
5917 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5918 $run ln "$obj" "$gentop/$newobj" ||
5919 $run cp "$obj" "$gentop/$newobj"
5920 oldobjs="$oldobjs $gentop/$newobj"
5922 *) oldobjs="$oldobjs $obj" ;;
5923 esac
5924 done
5927 eval cmds=\"$old_archive_cmds\"
5929 if len=`expr "X$cmds" : ".*"` &&
5930 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5931 cmds=$old_archive_cmds
5932 else
5933 # the command line is too long to link in one step, link in parts
5934 $echo "using piecewise archive linking..."
5935 save_RANLIB=$RANLIB
5936 RANLIB=:
5937 objlist=
5938 concat_cmds=
5939 save_oldobjs=$oldobjs
5941 # Is there a better way of finding the last object in the list?
5942 for obj in $save_oldobjs
5944 last_oldobj=$obj
5945 done
5946 for obj in $save_oldobjs
5948 oldobjs="$objlist $obj"
5949 objlist="$objlist $obj"
5950 eval test_cmds=\"$old_archive_cmds\"
5951 if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
5952 test "$len" -le "$max_cmd_len"; then
5954 else
5955 # the above command should be used before it gets too long
5956 oldobjs=$objlist
5957 if test "$obj" = "$last_oldobj" ; then
5958 RANLIB=$save_RANLIB
5960 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5961 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5962 objlist=
5964 done
5965 RANLIB=$save_RANLIB
5966 oldobjs=$objlist
5967 if test "X$oldobjs" = "X" ; then
5968 eval cmds=\"\$concat_cmds\"
5969 else
5970 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5974 save_ifs="$IFS"; IFS='~'
5975 for cmd in $cmds; do
5976 eval cmd=\"$cmd\"
5977 IFS="$save_ifs"
5978 $show "$cmd"
5979 $run eval "$cmd" || exit $?
5980 done
5981 IFS="$save_ifs"
5982 done
5984 if test -n "$generated"; then
5985 $show "${rm}r$generated"
5986 $run ${rm}r$generated
5989 # Now create the libtool archive.
5990 case $output in
5991 *.la)
5992 old_library=
5993 test "$build_old_libs" = yes && old_library="$libname.$libext"
5994 $show "creating $output"
5996 # Preserve any variables that may affect compiler behavior
5997 for var in $variables_saved_for_relink; do
5998 if eval test -z \"\${$var+set}\"; then
5999 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
6000 elif eval var_value=\$$var; test -z "$var_value"; then
6001 relink_command="$var=; export $var; $relink_command"
6002 else
6003 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
6004 relink_command="$var=\"$var_value\"; export $var; $relink_command"
6006 done
6007 # Quote the link command for shipping.
6008 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
6009 relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
6010 if test "$hardcode_automatic" = yes ; then
6011 relink_command=
6015 # Only create the output if not a dry run.
6016 if test -z "$run"; then
6017 for installed in no yes; do
6018 if test "$installed" = yes; then
6019 if test -z "$install_libdir"; then
6020 break
6022 output="$output_objdir/$outputname"i
6023 # Replace all uninstalled libtool libraries with the installed ones
6024 newdependency_libs=
6025 for deplib in $dependency_libs; do
6026 case $deplib in
6027 *.la)
6028 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
6029 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
6030 if test -z "$libdir"; then
6031 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
6032 exit $EXIT_FAILURE
6034 newdependency_libs="$newdependency_libs $libdir/$name"
6036 *) newdependency_libs="$newdependency_libs $deplib" ;;
6037 esac
6038 done
6039 dependency_libs="$newdependency_libs"
6040 newdlfiles=
6041 for lib in $dlfiles; do
6042 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
6043 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
6044 if test -z "$libdir"; then
6045 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6046 exit $EXIT_FAILURE
6048 newdlfiles="$newdlfiles $libdir/$name"
6049 done
6050 dlfiles="$newdlfiles"
6051 newdlprefiles=
6052 for lib in $dlprefiles; do
6053 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
6054 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
6055 if test -z "$libdir"; then
6056 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6057 exit $EXIT_FAILURE
6059 newdlprefiles="$newdlprefiles $libdir/$name"
6060 done
6061 dlprefiles="$newdlprefiles"
6062 else
6063 newdlfiles=
6064 for lib in $dlfiles; do
6065 case $lib in
6066 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
6067 *) abs=`pwd`"/$lib" ;;
6068 esac
6069 newdlfiles="$newdlfiles $abs"
6070 done
6071 dlfiles="$newdlfiles"
6072 newdlprefiles=
6073 for lib in $dlprefiles; do
6074 case $lib in
6075 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
6076 *) abs=`pwd`"/$lib" ;;
6077 esac
6078 newdlprefiles="$newdlprefiles $abs"
6079 done
6080 dlprefiles="$newdlprefiles"
6082 $rm $output
6083 # place dlname in correct position for cygwin
6084 tdlname=$dlname
6085 case $host,$output,$installed,$module,$dlname in
6086 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
6087 esac
6088 $echo > $output "\
6089 # $outputname - a libtool library file
6090 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
6092 # Please DO NOT delete this file!
6093 # It is necessary for linking the library.
6095 # The name that we can dlopen(3).
6096 dlname='$tdlname'
6098 # Names of this library.
6099 library_names='$library_names'
6101 # The name of the static archive.
6102 old_library='$old_library'
6104 # Libraries that this one depends upon.
6105 dependency_libs='$dependency_libs'
6107 # Version information for $libname.
6108 current=$current
6109 age=$age
6110 revision=$revision
6112 # Is this an already installed library?
6113 installed=$installed
6115 # Should we warn about portability when linking against -modules?
6116 shouldnotlink=$module
6118 # Files to dlopen/dlpreopen
6119 dlopen='$dlfiles'
6120 dlpreopen='$dlprefiles'
6122 # Directory that this library needs to be installed in:
6123 libdir='$install_libdir'"
6124 if test "$installed" = no && test "$need_relink" = yes; then
6125 $echo >> $output "\
6126 relink_command=\"$relink_command\""
6128 done
6131 # Do a symbolic link so that the libtool archive can be found in
6132 # LD_LIBRARY_PATH before the program is installed.
6133 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
6134 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
6136 esac
6137 exit $EXIT_SUCCESS
6140 # libtool install mode
6141 install)
6142 modename="$modename: install"
6144 # There may be an optional sh(1) argument at the beginning of
6145 # install_prog (especially on Windows NT).
6146 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
6147 # Allow the use of GNU shtool's install command.
6148 $echo "X$nonopt" | grep shtool > /dev/null; then
6149 # Aesthetically quote it.
6150 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
6151 case $arg in
6152 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6153 arg="\"$arg\""
6155 esac
6156 install_prog="$arg "
6157 arg="$1"
6158 shift
6159 else
6160 install_prog=
6161 arg=$nonopt
6164 # The real first argument should be the name of the installation program.
6165 # Aesthetically quote it.
6166 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
6167 case $arg in
6168 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6169 arg="\"$arg\""
6171 esac
6172 install_prog="$install_prog$arg"
6174 # We need to accept at least all the BSD install flags.
6175 dest=
6176 files=
6177 opts=
6178 prev=
6179 install_type=
6180 isdir=no
6181 stripme=
6182 for arg
6184 if test -n "$dest"; then
6185 files="$files $dest"
6186 dest=$arg
6187 continue
6190 case $arg in
6191 -d) isdir=yes ;;
6192 -f)
6193 case " $install_prog " in
6194 *[\\\ /]cp\ *) ;;
6195 *) prev=$arg ;;
6196 esac
6198 -g | -m | -o) prev=$arg ;;
6200 stripme=" -s"
6201 continue
6206 # If the previous option needed an argument, then skip it.
6207 if test -n "$prev"; then
6208 prev=
6209 else
6210 dest=$arg
6211 continue
6214 esac
6216 # Aesthetically quote the argument.
6217 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
6218 case $arg in
6219 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6220 arg="\"$arg\""
6222 esac
6223 install_prog="$install_prog $arg"
6224 done
6226 if test -z "$install_prog"; then
6227 $echo "$modename: you must specify an install program" 1>&2
6228 $echo "$help" 1>&2
6229 exit $EXIT_FAILURE
6232 if test -n "$prev"; then
6233 $echo "$modename: the \`$prev' option requires an argument" 1>&2
6234 $echo "$help" 1>&2
6235 exit $EXIT_FAILURE
6238 if test -z "$files"; then
6239 if test -z "$dest"; then
6240 $echo "$modename: no file or destination specified" 1>&2
6241 else
6242 $echo "$modename: you must specify a destination" 1>&2
6244 $echo "$help" 1>&2
6245 exit $EXIT_FAILURE
6248 # Strip any trailing slash from the destination.
6249 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
6251 # Check to see that the destination is a directory.
6252 test -d "$dest" && isdir=yes
6253 if test "$isdir" = yes; then
6254 destdir="$dest"
6255 destname=
6256 else
6257 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
6258 test "X$destdir" = "X$dest" && destdir=.
6259 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
6261 # Not a directory, so check to see that there is only one file specified.
6262 set dummy $files
6263 if test "$#" -gt 2; then
6264 $echo "$modename: \`$dest' is not a directory" 1>&2
6265 $echo "$help" 1>&2
6266 exit $EXIT_FAILURE
6269 case $destdir in
6270 [\\/]* | [A-Za-z]:[\\/]*) ;;
6272 for file in $files; do
6273 case $file in
6274 *.lo) ;;
6276 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
6277 $echo "$help" 1>&2
6278 exit $EXIT_FAILURE
6280 esac
6281 done
6283 esac
6285 # This variable tells wrapper scripts just to set variables rather
6286 # than running their programs.
6287 libtool_install_magic="$magic"
6289 staticlibs=
6290 future_libdirs=
6291 current_libdirs=
6292 for file in $files; do
6294 # Do each installation.
6295 case $file in
6296 *.$libext)
6297 # Do the static libraries later.
6298 staticlibs="$staticlibs $file"
6301 *.la)
6302 # Check to see that this really is a libtool archive.
6303 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6304 else
6305 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
6306 $echo "$help" 1>&2
6307 exit $EXIT_FAILURE
6310 library_names=
6311 old_library=
6312 relink_command=
6313 # If there is no directory component, then add one.
6314 case $file in
6315 */* | *\\*) . $file ;;
6316 *) . ./$file ;;
6317 esac
6319 # Add the libdir to current_libdirs if it is the destination.
6320 if test "X$destdir" = "X$libdir"; then
6321 case "$current_libdirs " in
6322 *" $libdir "*) ;;
6323 *) current_libdirs="$current_libdirs $libdir" ;;
6324 esac
6325 else
6326 # Note the libdir as a future libdir.
6327 case "$future_libdirs " in
6328 *" $libdir "*) ;;
6329 *) future_libdirs="$future_libdirs $libdir" ;;
6330 esac
6333 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
6334 test "X$dir" = "X$file/" && dir=
6335 dir="$dir$objdir"
6337 if test -n "$relink_command"; then
6338 # Determine the prefix the user has applied to our future dir.
6339 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
6341 # Don't allow the user to place us outside of our expected
6342 # location b/c this prevents finding dependent libraries that
6343 # are installed to the same prefix.
6344 # At present, this check doesn't affect windows .dll's that
6345 # are installed into $libdir/../bin (currently, that works fine)
6346 # but it's something to keep an eye on.
6347 if test "$inst_prefix_dir" = "$destdir"; then
6348 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
6349 exit $EXIT_FAILURE
6352 if test -n "$inst_prefix_dir"; then
6353 # Stick the inst_prefix_dir data into the link command.
6354 relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
6355 else
6356 relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
6359 $echo "$modename: warning: relinking \`$file'" 1>&2
6360 $show "$relink_command"
6361 if $run eval "$relink_command"; then :
6362 else
6363 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6364 exit $EXIT_FAILURE
6368 # See the names of the shared library.
6369 set dummy $library_names
6370 if test -n "$2"; then
6371 realname="$2"
6372 shift
6373 shift
6375 srcname="$realname"
6376 test -n "$relink_command" && srcname="$realname"T
6378 # Install the shared library and build the symlinks.
6379 $show "$install_prog $dir/$srcname $destdir/$realname"
6380 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
6381 if test -n "$stripme" && test -n "$striplib"; then
6382 $show "$striplib $destdir/$realname"
6383 $run eval "$striplib $destdir/$realname" || exit $?
6386 if test "$#" -gt 0; then
6387 # Delete the old symlinks, and create new ones.
6388 # Try `ln -sf' first, because the `ln' binary might depend on
6389 # the symlink we replace! Solaris /bin/ln does not understand -f,
6390 # so we also need to try rm && ln -s.
6391 for linkname
6393 if test "$linkname" != "$realname"; then
6394 $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6395 $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6397 done
6400 # Do each command in the postinstall commands.
6401 lib="$destdir/$realname"
6402 cmds=$postinstall_cmds
6403 save_ifs="$IFS"; IFS='~'
6404 for cmd in $cmds; do
6405 IFS="$save_ifs"
6406 eval cmd=\"$cmd\"
6407 $show "$cmd"
6408 $run eval "$cmd" || {
6409 lt_exit=$?
6411 # Restore the uninstalled library and exit
6412 if test "$mode" = relink; then
6413 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
6416 exit $lt_exit
6418 done
6419 IFS="$save_ifs"
6422 # Install the pseudo-library for information purposes.
6423 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6424 instname="$dir/$name"i
6425 $show "$install_prog $instname $destdir/$name"
6426 $run eval "$install_prog $instname $destdir/$name" || exit $?
6428 # Maybe install the static library, too.
6429 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
6432 *.lo)
6433 # Install (i.e. copy) a libtool object.
6435 # Figure out destination file name, if it wasn't already specified.
6436 if test -n "$destname"; then
6437 destfile="$destdir/$destname"
6438 else
6439 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6440 destfile="$destdir/$destfile"
6443 # Deduce the name of the destination old-style object file.
6444 case $destfile in
6445 *.lo)
6446 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
6448 *.$objext)
6449 staticdest="$destfile"
6450 destfile=
6453 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
6454 $echo "$help" 1>&2
6455 exit $EXIT_FAILURE
6457 esac
6459 # Install the libtool object if requested.
6460 if test -n "$destfile"; then
6461 $show "$install_prog $file $destfile"
6462 $run eval "$install_prog $file $destfile" || exit $?
6465 # Install the old object if enabled.
6466 if test "$build_old_libs" = yes; then
6467 # Deduce the name of the old-style object file.
6468 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
6470 $show "$install_prog $staticobj $staticdest"
6471 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
6473 exit $EXIT_SUCCESS
6477 # Figure out destination file name, if it wasn't already specified.
6478 if test -n "$destname"; then
6479 destfile="$destdir/$destname"
6480 else
6481 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6482 destfile="$destdir/$destfile"
6485 # If the file is missing, and there is a .exe on the end, strip it
6486 # because it is most likely a libtool script we actually want to
6487 # install
6488 stripped_ext=""
6489 case $file in
6490 *.exe)
6491 if test ! -f "$file"; then
6492 file=`$echo $file|${SED} 's,.exe$,,'`
6493 stripped_ext=".exe"
6496 esac
6498 # Do a test to see if this is really a libtool program.
6499 case $host in
6500 *cygwin*|*mingw*)
6501 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
6504 wrapper=$file
6506 esac
6507 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
6508 notinst_deplibs=
6509 relink_command=
6511 # Note that it is not necessary on cygwin/mingw to append a dot to
6512 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6513 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6514 # `FILE.' does not work on cygwin managed mounts.
6516 # If there is no directory component, then add one.
6517 case $wrapper in
6518 */* | *\\*) . ${wrapper} ;;
6519 *) . ./${wrapper} ;;
6520 esac
6522 # Check the variables that should have been set.
6523 if test -z "$notinst_deplibs"; then
6524 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
6525 exit $EXIT_FAILURE
6528 finalize=yes
6529 for lib in $notinst_deplibs; do
6530 # Check to see that each library is installed.
6531 libdir=
6532 if test -f "$lib"; then
6533 # If there is no directory component, then add one.
6534 case $lib in
6535 */* | *\\*) . $lib ;;
6536 *) . ./$lib ;;
6537 esac
6539 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
6540 if test -n "$libdir" && test ! -f "$libfile"; then
6541 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
6542 finalize=no
6544 done
6546 relink_command=
6547 # Note that it is not necessary on cygwin/mingw to append a dot to
6548 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6549 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6550 # `FILE.' does not work on cygwin managed mounts.
6552 # If there is no directory component, then add one.
6553 case $wrapper in
6554 */* | *\\*) . ${wrapper} ;;
6555 *) . ./${wrapper} ;;
6556 esac
6558 outputname=
6559 if test "$fast_install" = no && test -n "$relink_command"; then
6560 if test "$finalize" = yes && test -z "$run"; then
6561 tmpdir=`func_mktempdir`
6562 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6563 outputname="$tmpdir/$file"
6564 # Replace the output file specification.
6565 relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
6567 $show "$relink_command"
6568 if $run eval "$relink_command"; then :
6569 else
6570 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6571 ${rm}r "$tmpdir"
6572 continue
6574 file="$outputname"
6575 else
6576 $echo "$modename: warning: cannot relink \`$file'" 1>&2
6578 else
6579 # Install the binary that we compiled earlier.
6580 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
6584 # remove .exe since cygwin /usr/bin/install will append another
6585 # one anyway
6586 case $install_prog,$host in
6587 */usr/bin/install*,*cygwin*)
6588 case $file:$destfile in
6589 *.exe:*.exe)
6590 # this is ok
6592 *.exe:*)
6593 destfile=$destfile.exe
6595 *:*.exe)
6596 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
6598 esac
6600 esac
6601 $show "$install_prog$stripme $file $destfile"
6602 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
6603 test -n "$outputname" && ${rm}r "$tmpdir"
6605 esac
6606 done
6608 for file in $staticlibs; do
6609 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6611 # Set up the ranlib parameters.
6612 oldlib="$destdir/$name"
6614 $show "$install_prog $file $oldlib"
6615 $run eval "$install_prog \$file \$oldlib" || exit $?
6617 if test -n "$stripme" && test -n "$old_striplib"; then
6618 $show "$old_striplib $oldlib"
6619 $run eval "$old_striplib $oldlib" || exit $?
6622 # Do each command in the postinstall commands.
6623 cmds=$old_postinstall_cmds
6624 save_ifs="$IFS"; IFS='~'
6625 for cmd in $cmds; do
6626 IFS="$save_ifs"
6627 eval cmd=\"$cmd\"
6628 $show "$cmd"
6629 $run eval "$cmd" || exit $?
6630 done
6631 IFS="$save_ifs"
6632 done
6634 if test -n "$future_libdirs"; then
6635 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
6638 if test -n "$current_libdirs"; then
6639 # Maybe just do a dry run.
6640 test -n "$run" && current_libdirs=" -n$current_libdirs"
6641 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
6642 else
6643 exit $EXIT_SUCCESS
6647 # libtool finish mode
6648 finish)
6649 modename="$modename: finish"
6650 libdirs="$nonopt"
6651 admincmds=
6653 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
6654 for dir
6656 libdirs="$libdirs $dir"
6657 done
6659 for libdir in $libdirs; do
6660 if test -n "$finish_cmds"; then
6661 # Do each command in the finish commands.
6662 cmds=$finish_cmds
6663 save_ifs="$IFS"; IFS='~'
6664 for cmd in $cmds; do
6665 IFS="$save_ifs"
6666 eval cmd=\"$cmd\"
6667 $show "$cmd"
6668 $run eval "$cmd" || admincmds="$admincmds
6669 $cmd"
6670 done
6671 IFS="$save_ifs"
6673 if test -n "$finish_eval"; then
6674 # Do the single finish_eval.
6675 eval cmds=\"$finish_eval\"
6676 $run eval "$cmds" || admincmds="$admincmds
6677 $cmds"
6679 done
6682 # Exit here if they wanted silent mode.
6683 test "$show" = : && exit $EXIT_SUCCESS
6685 $echo "X----------------------------------------------------------------------" | $Xsed
6686 $echo "Libraries have been installed in:"
6687 for libdir in $libdirs; do
6688 $echo " $libdir"
6689 done
6690 $echo
6691 $echo "If you ever happen to want to link against installed libraries"
6692 $echo "in a given directory, LIBDIR, you must either use libtool, and"
6693 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6694 $echo "flag during linking and do at least one of the following:"
6695 if test -n "$shlibpath_var"; then
6696 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6697 $echo " during execution"
6699 if test -n "$runpath_var"; then
6700 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
6701 $echo " during linking"
6703 if test -n "$hardcode_libdir_flag_spec"; then
6704 libdir=LIBDIR
6705 eval flag=\"$hardcode_libdir_flag_spec\"
6707 $echo " - use the \`$flag' linker flag"
6709 if test -n "$admincmds"; then
6710 $echo " - have your system administrator run these commands:$admincmds"
6712 if test -f /etc/ld.so.conf; then
6713 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6715 $echo
6716 $echo "See any operating system documentation about shared libraries for"
6717 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6718 $echo "X----------------------------------------------------------------------" | $Xsed
6719 exit $EXIT_SUCCESS
6722 # libtool execute mode
6723 execute)
6724 modename="$modename: execute"
6726 # The first argument is the command name.
6727 cmd="$nonopt"
6728 if test -z "$cmd"; then
6729 $echo "$modename: you must specify a COMMAND" 1>&2
6730 $echo "$help"
6731 exit $EXIT_FAILURE
6734 # Handle -dlopen flags immediately.
6735 for file in $execute_dlfiles; do
6736 if test ! -f "$file"; then
6737 $echo "$modename: \`$file' is not a file" 1>&2
6738 $echo "$help" 1>&2
6739 exit $EXIT_FAILURE
6742 dir=
6743 case $file in
6744 *.la)
6745 # Check to see that this really is a libtool archive.
6746 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6747 else
6748 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6749 $echo "$help" 1>&2
6750 exit $EXIT_FAILURE
6753 # Read the libtool library.
6754 dlname=
6755 library_names=
6757 # If there is no directory component, then add one.
6758 case $file in
6759 */* | *\\*) . $file ;;
6760 *) . ./$file ;;
6761 esac
6763 # Skip this library if it cannot be dlopened.
6764 if test -z "$dlname"; then
6765 # Warn if it was a shared library.
6766 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6767 continue
6770 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6771 test "X$dir" = "X$file" && dir=.
6773 if test -f "$dir/$objdir/$dlname"; then
6774 dir="$dir/$objdir"
6775 else
6776 if test ! -f "$dir/$dlname"; then
6777 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6778 exit $EXIT_FAILURE
6783 *.lo)
6784 # Just add the directory containing the .lo file.
6785 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6786 test "X$dir" = "X$file" && dir=.
6790 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6791 continue
6793 esac
6795 # Get the absolute pathname.
6796 absdir=`cd "$dir" && pwd`
6797 test -n "$absdir" && dir="$absdir"
6799 # Now add the directory to shlibpath_var.
6800 if eval "test -z \"\$$shlibpath_var\""; then
6801 eval "$shlibpath_var=\"\$dir\""
6802 else
6803 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6805 done
6807 # This variable tells wrapper scripts just to set shlibpath_var
6808 # rather than running their programs.
6809 libtool_execute_magic="$magic"
6811 # Check if any of the arguments is a wrapper script.
6812 args=
6813 for file
6815 case $file in
6816 -*) ;;
6818 # Do a test to see if this is really a libtool program.
6819 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6820 # If there is no directory component, then add one.
6821 case $file in
6822 */* | *\\*) . $file ;;
6823 *) . ./$file ;;
6824 esac
6826 # Transform arg to wrapped name.
6827 file="$progdir/$program"
6830 esac
6831 # Quote arguments (to preserve shell metacharacters).
6832 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6833 args="$args \"$file\""
6834 done
6836 if test -z "$run"; then
6837 if test -n "$shlibpath_var"; then
6838 # Export the shlibpath_var.
6839 eval "export $shlibpath_var"
6842 # Restore saved environment variables
6843 for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
6845 eval "if test \"\${save_$lt_var+set}\" = set; then
6846 $lt_var=\$save_$lt_var; export $lt_var
6848 done
6850 # Now prepare to actually exec the command.
6851 exec_cmd="\$cmd$args"
6852 else
6853 # Display what would be done.
6854 if test -n "$shlibpath_var"; then
6855 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6856 $echo "export $shlibpath_var"
6858 $echo "$cmd$args"
6859 exit $EXIT_SUCCESS
6863 # libtool clean and uninstall mode
6864 clean | uninstall)
6865 modename="$modename: $mode"
6866 rm="$nonopt"
6867 files=
6868 rmforce=
6869 exit_status=0
6871 # This variable tells wrapper scripts just to set variables rather
6872 # than running their programs.
6873 libtool_install_magic="$magic"
6875 for arg
6877 case $arg in
6878 -f) rm="$rm $arg"; rmforce=yes ;;
6879 -*) rm="$rm $arg" ;;
6880 *) files="$files $arg" ;;
6881 esac
6882 done
6884 if test -z "$rm"; then
6885 $echo "$modename: you must specify an RM program" 1>&2
6886 $echo "$help" 1>&2
6887 exit $EXIT_FAILURE
6890 rmdirs=
6892 origobjdir="$objdir"
6893 for file in $files; do
6894 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6895 if test "X$dir" = "X$file"; then
6896 dir=.
6897 objdir="$origobjdir"
6898 else
6899 objdir="$dir/$origobjdir"
6901 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6902 test "$mode" = uninstall && objdir="$dir"
6904 # Remember objdir for removal later, being careful to avoid duplicates
6905 if test "$mode" = clean; then
6906 case " $rmdirs " in
6907 *" $objdir "*) ;;
6908 *) rmdirs="$rmdirs $objdir" ;;
6909 esac
6912 # Don't error if the file doesn't exist and rm -f was used.
6913 if (test -L "$file") >/dev/null 2>&1 \
6914 || (test -h "$file") >/dev/null 2>&1 \
6915 || test -f "$file"; then
6917 elif test -d "$file"; then
6918 exit_status=1
6919 continue
6920 elif test "$rmforce" = yes; then
6921 continue
6924 rmfiles="$file"
6926 case $name in
6927 *.la)
6928 # Possibly a libtool archive, so verify it.
6929 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6930 . $dir/$name
6932 # Delete the libtool libraries and symlinks.
6933 for n in $library_names; do
6934 rmfiles="$rmfiles $objdir/$n"
6935 done
6936 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6938 case "$mode" in
6939 clean)
6940 case " $library_names " in
6941 # " " in the beginning catches empty $dlname
6942 *" $dlname "*) ;;
6943 *) rmfiles="$rmfiles $objdir/$dlname" ;;
6944 esac
6945 test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6947 uninstall)
6948 if test -n "$library_names"; then
6949 # Do each command in the postuninstall commands.
6950 cmds=$postuninstall_cmds
6951 save_ifs="$IFS"; IFS='~'
6952 for cmd in $cmds; do
6953 IFS="$save_ifs"
6954 eval cmd=\"$cmd\"
6955 $show "$cmd"
6956 $run eval "$cmd"
6957 if test "$?" -ne 0 && test "$rmforce" != yes; then
6958 exit_status=1
6960 done
6961 IFS="$save_ifs"
6964 if test -n "$old_library"; then
6965 # Do each command in the old_postuninstall commands.
6966 cmds=$old_postuninstall_cmds
6967 save_ifs="$IFS"; IFS='~'
6968 for cmd in $cmds; do
6969 IFS="$save_ifs"
6970 eval cmd=\"$cmd\"
6971 $show "$cmd"
6972 $run eval "$cmd"
6973 if test "$?" -ne 0 && test "$rmforce" != yes; then
6974 exit_status=1
6976 done
6977 IFS="$save_ifs"
6979 # FIXME: should reinstall the best remaining shared library.
6981 esac
6985 *.lo)
6986 # Possibly a libtool object, so verify it.
6987 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6989 # Read the .lo file
6990 . $dir/$name
6992 # Add PIC object to the list of files to remove.
6993 if test -n "$pic_object" \
6994 && test "$pic_object" != none; then
6995 rmfiles="$rmfiles $dir/$pic_object"
6998 # Add non-PIC object to the list of files to remove.
6999 if test -n "$non_pic_object" \
7000 && test "$non_pic_object" != none; then
7001 rmfiles="$rmfiles $dir/$non_pic_object"
7007 if test "$mode" = clean ; then
7008 noexename=$name
7009 case $file in
7010 *.exe)
7011 file=`$echo $file|${SED} 's,.exe$,,'`
7012 noexename=`$echo $name|${SED} 's,.exe$,,'`
7013 # $file with .exe has already been added to rmfiles,
7014 # add $file without .exe
7015 rmfiles="$rmfiles $file"
7017 esac
7018 # Do a test to see if this is a libtool program.
7019 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
7020 relink_command=
7021 . $dir/$noexename
7023 # note $name still contains .exe if it was in $file originally
7024 # as does the version of $file that was added into $rmfiles
7025 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
7026 if test "$fast_install" = yes && test -n "$relink_command"; then
7027 rmfiles="$rmfiles $objdir/lt-$name"
7029 if test "X$noexename" != "X$name" ; then
7030 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
7035 esac
7036 $show "$rm $rmfiles"
7037 $run $rm $rmfiles || exit_status=1
7038 done
7039 objdir="$origobjdir"
7041 # Try to remove the ${objdir}s in the directories where we deleted files
7042 for dir in $rmdirs; do
7043 if test -d "$dir"; then
7044 $show "rmdir $dir"
7045 $run rmdir $dir >/dev/null 2>&1
7047 done
7049 exit $exit_status
7053 $echo "$modename: you must specify a MODE" 1>&2
7054 $echo "$generic_help" 1>&2
7055 exit $EXIT_FAILURE
7057 esac
7059 if test -z "$exec_cmd"; then
7060 $echo "$modename: invalid operation mode \`$mode'" 1>&2
7061 $echo "$generic_help" 1>&2
7062 exit $EXIT_FAILURE
7064 fi # test -z "$show_help"
7066 if test -n "$exec_cmd"; then
7067 eval exec $exec_cmd
7068 exit $EXIT_FAILURE
7071 # We need to display help for each of the modes.
7072 case $mode in
7073 "") $echo \
7074 "Usage: $modename [OPTION]... [MODE-ARG]...
7076 Provide generalized library-building support services.
7078 --config show all configuration variables
7079 --debug enable verbose shell tracing
7080 -n, --dry-run display commands without modifying any files
7081 --features display basic configuration information and exit
7082 --finish same as \`--mode=finish'
7083 --help display this help message and exit
7084 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
7085 --quiet same as \`--silent'
7086 --silent don't print informational messages
7087 --tag=TAG use configuration variables from tag TAG
7088 --version print version information
7090 MODE must be one of the following:
7092 clean remove files from the build directory
7093 compile compile a source file into a libtool object
7094 execute automatically set library path, then run a program
7095 finish complete the installation of libtool libraries
7096 install install libraries or executables
7097 link create a library or an executable
7098 uninstall remove libraries from an installed directory
7100 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
7101 a more detailed description of MODE.
7103 Report bugs to <bug-libtool@gnu.org>."
7104 exit $EXIT_SUCCESS
7107 clean)
7108 $echo \
7109 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
7111 Remove files from the build directory.
7113 RM is the name of the program to use to delete files associated with each FILE
7114 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
7115 to RM.
7117 If FILE is a libtool library, object or program, all the files associated
7118 with it are deleted. Otherwise, only FILE itself is deleted using RM."
7121 compile)
7122 $echo \
7123 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
7125 Compile a source file into a libtool library object.
7127 This mode accepts the following additional options:
7129 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
7130 -prefer-pic try to building PIC objects only
7131 -prefer-non-pic try to building non-PIC objects only
7132 -static always build a \`.o' file suitable for static linking
7134 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
7135 from the given SOURCEFILE.
7137 The output file name is determined by removing the directory component from
7138 SOURCEFILE, then substituting the C source code suffix \`.c' with the
7139 library object suffix, \`.lo'."
7142 execute)
7143 $echo \
7144 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
7146 Automatically set library path, then run a program.
7148 This mode accepts the following additional options:
7150 -dlopen FILE add the directory containing FILE to the library path
7152 This mode sets the library path environment variable according to \`-dlopen'
7153 flags.
7155 If any of the ARGS are libtool executable wrappers, then they are translated
7156 into their corresponding uninstalled binary, and any of their required library
7157 directories are added to the library path.
7159 Then, COMMAND is executed, with ARGS as arguments."
7162 finish)
7163 $echo \
7164 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
7166 Complete the installation of libtool libraries.
7168 Each LIBDIR is a directory that contains libtool libraries.
7170 The commands that this mode executes may require superuser privileges. Use
7171 the \`--dry-run' option if you just want to see what would be executed."
7174 install)
7175 $echo \
7176 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
7178 Install executables or libraries.
7180 INSTALL-COMMAND is the installation command. The first component should be
7181 either the \`install' or \`cp' program.
7183 The rest of the components are interpreted as arguments to that command (only
7184 BSD-compatible install options are recognized)."
7187 link)
7188 $echo \
7189 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
7191 Link object files or libraries together to form another library, or to
7192 create an executable program.
7194 LINK-COMMAND is a command using the C compiler that you would use to create
7195 a program from several object files.
7197 The following components of LINK-COMMAND are treated specially:
7199 -all-static do not do any dynamic linking at all
7200 -avoid-version do not add a version suffix if possible
7201 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
7202 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
7203 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
7204 -export-symbols SYMFILE
7205 try to export only the symbols listed in SYMFILE
7206 -export-symbols-regex REGEX
7207 try to export only the symbols matching REGEX
7208 -LLIBDIR search LIBDIR for required installed libraries
7209 -lNAME OUTPUT-FILE requires the installed library libNAME
7210 -module build a library that can dlopened
7211 -no-fast-install disable the fast-install mode
7212 -no-install link a not-installable executable
7213 -no-undefined declare that a library does not refer to external symbols
7214 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
7215 -objectlist FILE Use a list of object files found in FILE to specify objects
7216 -precious-files-regex REGEX
7217 don't remove output files matching REGEX
7218 -release RELEASE specify package release information
7219 -rpath LIBDIR the created library will eventually be installed in LIBDIR
7220 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
7221 -static do not do any dynamic linking of uninstalled libtool libraries
7222 -static-libtool-libs
7223 do not do any dynamic linking of libtool libraries
7224 -version-info CURRENT[:REVISION[:AGE]]
7225 specify library version info [each variable defaults to 0]
7227 All other options (arguments beginning with \`-') are ignored.
7229 Every other argument is treated as a filename. Files ending in \`.la' are
7230 treated as uninstalled libtool libraries, other files are standard or library
7231 object files.
7233 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
7234 only library objects (\`.lo' files) may be specified, and \`-rpath' is
7235 required, except when creating a convenience library.
7237 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
7238 using \`ar' and \`ranlib', or on Windows using \`lib'.
7240 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
7241 is created, otherwise an executable program is created."
7244 uninstall)
7245 $echo \
7246 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
7248 Remove libraries from an installation directory.
7250 RM is the name of the program to use to delete files associated with each FILE
7251 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
7252 to RM.
7254 If FILE is a libtool library, all the files associated with it are deleted.
7255 Otherwise, only FILE itself is deleted using RM."
7259 $echo "$modename: invalid operation mode \`$mode'" 1>&2
7260 $echo "$help" 1>&2
7261 exit $EXIT_FAILURE
7263 esac
7265 $echo
7266 $echo "Try \`$modename --help' for more information about other modes."
7268 exit $?
7270 # The TAGs below are defined such that we never get into a situation
7271 # in which we disable both kinds of libraries. Given conflicting
7272 # choices, we go for a static library, that is the most portable,
7273 # since we can't tell whether shared libraries were disabled because
7274 # the user asked for that or because the platform doesn't support
7275 # them. This is particularly important on AIX, because we don't
7276 # support having both static and shared libraries enabled at the same
7277 # time on that platform, so we default to a shared-only configuration.
7278 # If a disable-shared tag is given, we'll fallback to a static-only
7279 # configuration. But we'll never go from static-only to shared-only.
7281 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
7282 disable_libs=shared
7283 # ### END LIBTOOL TAG CONFIG: disable-shared
7285 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
7286 disable_libs=static
7287 # ### END LIBTOOL TAG CONFIG: disable-static
7289 # Local Variables:
7290 # mode:shell-script
7291 # sh-indentation:2
7292 # End:
7293 # ### BEGIN LIBTOOL TAG CONFIG: CXX
7295 # Libtool was configured on host D293LXD1:
7297 # Shell to use when invoking shell scripts.
7298 SHELL="/bin/sh"
7300 # Whether or not to build shared libraries.
7301 build_libtool_libs=yes
7303 # Whether or not to build static libraries.
7304 build_old_libs=yes
7306 # Whether or not to add -lc for building shared libraries.
7307 build_libtool_need_lc=no
7309 # Whether or not to disallow shared libs when runtime libs are static
7310 allow_libtool_libs_with_static_runtimes=yes
7312 # Whether or not to optimize for fast installation.
7313 fast_install=needless
7315 # The host system.
7316 host_alias=
7317 host=i686-pc-mingw32
7318 host_os=mingw32
7320 # The build system.
7321 build_alias=i686-pc-mingw32
7322 build=i686-pc-mingw32
7323 build_os=mingw32
7325 # An echo program that does not interpret backslashes.
7326 echo="echo"
7328 # The archiver.
7329 AR="ar"
7330 AR_FLAGS="cru"
7332 # A C compiler.
7333 LTCC="gcc"
7335 # LTCC compiler flags.
7336 LTCFLAGS="-g -O2"
7338 # A language-specific compiler.
7339 CC="g++"
7341 # Is the compiler the GNU C compiler?
7342 with_gcc=yes
7344 # An ERE matcher.
7345 EGREP="/bin/grep -E"
7347 # The linker used to build libraries.
7348 LD="/i686-pc-msys/bin/ld.exe"
7350 # Whether we need hard or soft links.
7351 LN_S="cp -p"
7353 # A BSD-compatible nm program.
7354 NM="/bin/nm -B"
7356 # A symbol stripping program
7357 STRIP="strip"
7359 # Used to examine libraries when file_magic_cmd begins "file"
7360 MAGIC_CMD=file
7362 # Used on cygwin: DLL creation program.
7363 DLLTOOL="dlltool"
7365 # Used on cygwin: object dumper.
7366 OBJDUMP="objdump"
7368 # Used on cygwin: assembler.
7369 AS="as"
7371 # The name of the directory that contains temporary libtool files.
7372 objdir=.libs
7374 # How to create reloadable object files.
7375 reload_flag=" -r"
7376 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
7378 # How to pass a linker flag through the compiler.
7379 wl="-Wl,"
7381 # Object file suffix (normally "o").
7382 objext="o"
7384 # Old archive suffix (normally "a").
7385 libext="a"
7387 # Shared library suffix (normally ".so").
7388 shrext_cmds='.dll'
7390 # Executable file suffix (normally "").
7391 exeext=""
7393 # Additional compiler flags for building library objects.
7394 pic_flag=" -DDLL_EXPORT -DPIC"
7395 pic_mode=default
7397 # What is the maximum length of a command?
7398 max_cmd_len=8192
7400 # Does compiler simultaneously support -c and -o options?
7401 compiler_c_o="yes"
7403 # Must we lock files when doing compilation?
7404 need_locks="no"
7406 # Do we need the lib prefix for modules?
7407 need_lib_prefix=no
7409 # Do we need a version for libraries?
7410 need_version=no
7412 # Whether dlopen is supported.
7413 dlopen_support=yes
7415 # Whether dlopen of programs is supported.
7416 dlopen_self=unknown
7418 # Whether dlopen of statically linked programs is supported.
7419 dlopen_self_static=unknown
7421 # Compiler flag to prevent dynamic linking.
7422 link_static_flag=""
7424 # Compiler flag to turn off builtin functions.
7425 no_builtin_flag=" -fno-builtin"
7427 # Compiler flag to allow reflexive dlopens.
7428 export_dynamic_flag_spec="\${wl}--export-dynamic"
7430 # Compiler flag to generate shared objects directly from archives.
7431 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
7433 # Compiler flag to generate thread-safe objects.
7434 thread_safe_flag_spec=""
7436 # Library versioning type.
7437 version_type=windows
7439 # Format of library name prefix.
7440 libname_spec="lib\$name"
7442 # List of archive names. First name is the real one, the rest are links.
7443 # The last name is the one that the linker finds with -lNAME.
7444 library_names_spec="\$libname.dll.a"
7446 # The coded name of the library, if different from the real name.
7447 soname_spec="\${libname}\`echo \${release} | \$SED -e s/[.]/-/g\`\${versuffix}\${shared_ext}"
7449 # Commands used to build and install an old-style archive.
7450 RANLIB="ranlib"
7451 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
7452 old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
7453 old_postuninstall_cmds=""
7455 # Create an old-style archive from a shared archive.
7456 old_archive_from_new_cmds=""
7458 # Create a temporary old-style archive to link instead of a shared archive.
7459 old_archive_from_expsyms_cmds=""
7461 # Commands used to build and install a shared archive.
7462 archive_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib"
7463 archive_expsym_cmds="if test \\\"x\\\`\$SED 1q \$export_symbols\\\`\\\" = xEXPORTS; then
7464 cp \$export_symbols \$output_objdir/\$soname.def;
7465 else
7466 echo EXPORTS > \$output_objdir/\$soname.def;
7467 cat \$export_symbols >> \$output_objdir/\$soname.def;
7469 \$CC -shared -nostdlib \$output_objdir/\$soname.def \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib"
7470 postinstall_cmds="base_file=\\\`basename \\\${file}\\\`~
7471 dlpath=\\\`\$SHELL 2>&1 -c '. \$dir/'\\\${base_file}'i;echo \\\$dlname'\\\`~
7472 dldir=\$destdir/\\\`dirname \\\$dlpath\\\`~
7473 test -d \\\$dldir || mkdir -p \\\$dldir~
7474 \$install_prog \$dir/\$dlname \\\$dldir/\$dlname~
7475 chmod a+x \\\$dldir/\$dlname"
7476 postuninstall_cmds="dldll=\\\`\$SHELL 2>&1 -c '. \$file; echo \\\$dlname'\\\`~
7477 dlpath=\$dir/\\\$dldll~
7478 \$rm \\\$dlpath"
7480 # Commands used to build a loadable module (assumed same as above if empty)
7481 module_cmds=""
7482 module_expsym_cmds=""
7484 # Commands to strip libraries.
7485 old_striplib="strip --strip-debug"
7486 striplib="strip --strip-unneeded"
7488 # Dependencies to place before the objects being linked to create a
7489 # shared library.
7490 predep_objects=""
7492 # Dependencies to place after the objects being linked to create a
7493 # shared library.
7494 postdep_objects=""
7496 # Dependencies to place before the objects being linked to create a
7497 # shared library.
7498 predeps=""
7500 # Dependencies to place after the objects being linked to create a
7501 # shared library.
7502 postdeps="-lstdc++ -lgcc -lmsys-1.0 -luser32 -lkernel32 -ladvapi32 -lshell32 -lgcc"
7504 # The library search path used internally by the compiler when linking
7505 # a shared library.
7506 compiler_lib_search_path="-L/usr/lib -L/usr/lib -L/bin/../lib/gcc-lib/i686-pc-msys/2.95.3-1 -L/bin/../lib/gcc-lib -L/usr/lib/gcc-lib/i686-pc-msys/2.95.3-1 -L/bin/../lib/gcc-lib/i686-pc-msys/2.95.3-1/../../../../i686-pc-msys/lib -L/usr/lib/gcc-lib/i686-pc-msys/2.95.3-1/../../../../i686-pc-msys/lib"
7508 # Method to check whether dependent libraries are shared objects.
7509 deplibs_check_method="file_magic file format pei*-i386(.*architecture: i386)?"
7511 # Command to use when deplibs_check_method == file_magic.
7512 file_magic_cmd="\$OBJDUMP -f"
7514 # Flag that allows shared libraries with undefined symbols to be built.
7515 allow_undefined_flag="unsupported"
7517 # Flag that forces no undefined symbols.
7518 no_undefined_flag=""
7520 # Commands used to finish a libtool library installation in a directory.
7521 finish_cmds=""
7523 # Same as above, but a single script fragment to be evaled but not shown.
7524 finish_eval=""
7526 # Take the output of nm and produce a listing of raw symbols and C names.
7527 global_symbol_pipe=""
7529 # Transform the output of nm in a proper C declaration
7530 global_symbol_to_cdecl=""
7532 # Transform the output of nm in a C name address pair
7533 global_symbol_to_c_name_address=""
7535 # This is the shared library runtime path variable.
7536 runpath_var=LD_RUN_PATH
7538 # This is the shared library path variable.
7539 shlibpath_var=PATH
7541 # Is shlibpath searched before the hard-coded library search path?
7542 shlibpath_overrides_runpath=yes
7544 # How to hardcode a shared library path into an executable.
7545 hardcode_action=immediate
7547 # Whether we should hardcode library paths into libraries.
7548 hardcode_into_libs=no
7550 # Flag to hardcode $libdir into a binary during linking.
7551 # This must work even if $libdir does not exist.
7552 hardcode_libdir_flag_spec="-L\$libdir"
7554 # If ld is used when linking, flag to hardcode $libdir into
7555 # a binary during linking. This must work even if $libdir does
7556 # not exist.
7557 hardcode_libdir_flag_spec_ld=""
7559 # Whether we need a single -rpath flag with a separated argument.
7560 hardcode_libdir_separator=""
7562 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
7563 # resulting binary.
7564 hardcode_direct=no
7566 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
7567 # resulting binary.
7568 hardcode_minus_L=no
7570 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
7571 # the resulting binary.
7572 hardcode_shlibpath_var=unsupported
7574 # Set to yes if building a shared library automatically hardcodes DIR into the library
7575 # and all subsequent libraries and executables linked against it.
7576 hardcode_automatic=no
7578 # Variables whose values should be saved in libtool wrapper scripts and
7579 # restored at relink time.
7580 variables_saved_for_relink="PATH PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
7582 # Whether libtool must link a program against all its dependency libraries.
7583 link_all_deplibs=unknown
7585 # Compile-time system search path for libraries
7586 sys_lib_search_path_spec=" /bin/../lib/gcc-lib/i686-pc-msys/2.95.3-1/ /bin/../lib/gcc-lib/ /usr/lib/gcc-lib/i686-pc-msys/2.95.3-1/ /usr/lib/gcc/i686-pc-msys/2.95.3-1/ /bin/../lib/gcc-lib/i686-pc-msys/2.95.3-1/../../../../i686-pc-msys/lib/i686-pc-msys/2.95.3-1/ /bin/../lib/gcc-lib/i686-pc-msys/2.95.3-1/../../../../i686-pc-msys/lib/ /usr/lib/gcc-lib/i686-pc-msys/2.95.3-1/../../../../i686-pc-msys/lib/i686-pc-msys/2.95.3-1/ /usr/lib/gcc-lib/i686-pc-msys/2.95.3-1/../../../../i686-pc-msys/lib/"
7588 # Run-time system search path for libraries
7589 sys_lib_dlsearch_path_spec="/lib /usr/lib"
7591 # Fix the shell variable $srcfile for the compiler.
7592 fix_srcfile_path=""
7594 # Set to yes if exported symbols are required.
7595 always_export_symbols=no
7597 # The commands to list exported symbols.
7598 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED -e '/^[BCDGRS][ ]/s/.*[ ]\\\\([^ ]*\\\\)/\\\\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\\\\([^ ]*\\\\)[ ][^ ]*/\\\\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.*[ ]//' | sort | uniq > \$export_symbols"
7600 # The commands to extract the exported symbol list from a shared archive.
7601 extract_expsyms_cmds=""
7603 # Symbols that should not be listed in the preloaded symbols.
7604 exclude_expsyms=""
7606 # Symbols that must always be exported.
7607 include_expsyms=""
7609 # ### END LIBTOOL TAG CONFIG: CXX
7611 # ### BEGIN LIBTOOL TAG CONFIG: F77
7613 # Libtool was configured on host D293LXD1:
7615 # Shell to use when invoking shell scripts.
7616 SHELL="/bin/sh"
7618 # Whether or not to build shared libraries.
7619 build_libtool_libs=yes
7621 # Whether or not to build static libraries.
7622 build_old_libs=yes
7624 # Whether or not to add -lc for building shared libraries.
7625 build_libtool_need_lc=no
7627 # Whether or not to disallow shared libs when runtime libs are static
7628 allow_libtool_libs_with_static_runtimes=yes
7630 # Whether or not to optimize for fast installation.
7631 fast_install=needless
7633 # The host system.
7634 host_alias=
7635 host=i686-pc-mingw32
7636 host_os=mingw32
7638 # The build system.
7639 build_alias=i686-pc-mingw32
7640 build=i686-pc-mingw32
7641 build_os=mingw32
7643 # An echo program that does not interpret backslashes.
7644 echo="echo"
7646 # The archiver.
7647 AR="ar"
7648 AR_FLAGS="cru"
7650 # A C compiler.
7651 LTCC="gcc"
7653 # LTCC compiler flags.
7654 LTCFLAGS="-g -O2"
7656 # A language-specific compiler.
7657 CC="g77"
7659 # Is the compiler the GNU C compiler?
7660 with_gcc=yes
7662 # An ERE matcher.
7663 EGREP="/bin/grep -E"
7665 # The linker used to build libraries.
7666 LD="/i686-pc-msys/bin/ld.exe"
7668 # Whether we need hard or soft links.
7669 LN_S="cp -p"
7671 # A BSD-compatible nm program.
7672 NM="/bin/nm -B"
7674 # A symbol stripping program
7675 STRIP="strip"
7677 # Used to examine libraries when file_magic_cmd begins "file"
7678 MAGIC_CMD=file
7680 # Used on cygwin: DLL creation program.
7681 DLLTOOL="dlltool"
7683 # Used on cygwin: object dumper.
7684 OBJDUMP="objdump"
7686 # Used on cygwin: assembler.
7687 AS="as"
7689 # The name of the directory that contains temporary libtool files.
7690 objdir=.libs
7692 # How to create reloadable object files.
7693 reload_flag=" -r"
7694 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
7696 # How to pass a linker flag through the compiler.
7697 wl="-Wl,"
7699 # Object file suffix (normally "o").
7700 objext="o"
7702 # Old archive suffix (normally "a").
7703 libext="a"
7705 # Shared library suffix (normally ".so").
7706 shrext_cmds='.dll'
7708 # Executable file suffix (normally "").
7709 exeext=""
7711 # Additional compiler flags for building library objects.
7712 pic_flag=" -DDLL_EXPORT"
7713 pic_mode=default
7715 # What is the maximum length of a command?
7716 max_cmd_len=8192
7718 # Does compiler simultaneously support -c and -o options?
7719 compiler_c_o="yes"
7721 # Must we lock files when doing compilation?
7722 need_locks="no"
7724 # Do we need the lib prefix for modules?
7725 need_lib_prefix=no
7727 # Do we need a version for libraries?
7728 need_version=no
7730 # Whether dlopen is supported.
7731 dlopen_support=yes
7733 # Whether dlopen of programs is supported.
7734 dlopen_self=unknown
7736 # Whether dlopen of statically linked programs is supported.
7737 dlopen_self_static=unknown
7739 # Compiler flag to prevent dynamic linking.
7740 link_static_flag=""
7742 # Compiler flag to turn off builtin functions.
7743 no_builtin_flag=""
7745 # Compiler flag to allow reflexive dlopens.
7746 export_dynamic_flag_spec="\${wl}--export-dynamic"
7748 # Compiler flag to generate shared objects directly from archives.
7749 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
7751 # Compiler flag to generate thread-safe objects.
7752 thread_safe_flag_spec=""
7754 # Library versioning type.
7755 version_type=windows
7757 # Format of library name prefix.
7758 libname_spec="lib\$name"
7760 # List of archive names. First name is the real one, the rest are links.
7761 # The last name is the one that the linker finds with -lNAME.
7762 library_names_spec="\$libname.dll.a"
7764 # The coded name of the library, if different from the real name.
7765 soname_spec="\${libname}\`echo \${release} | \$SED -e s/[.]/-/g\`\${versuffix}\${shared_ext}"
7767 # Commands used to build and install an old-style archive.
7768 RANLIB="ranlib"
7769 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
7770 old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
7771 old_postuninstall_cmds=""
7773 # Create an old-style archive from a shared archive.
7774 old_archive_from_new_cmds=""
7776 # Create a temporary old-style archive to link instead of a shared archive.
7777 old_archive_from_expsyms_cmds=""
7779 # Commands used to build and install a shared archive.
7780 archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib"
7781 archive_expsym_cmds="if test \\\"x\\\`\$SED 1q \$export_symbols\\\`\\\" = xEXPORTS; then
7782 cp \$export_symbols \$output_objdir/\$soname.def;
7783 else
7784 echo EXPORTS > \$output_objdir/\$soname.def;
7785 cat \$export_symbols >> \$output_objdir/\$soname.def;
7787 \$CC -shared \$output_objdir/\$soname.def \$libobjs \$deplibs \$compiler_flags -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib"
7788 postinstall_cmds="base_file=\\\`basename \\\${file}\\\`~
7789 dlpath=\\\`\$SHELL 2>&1 -c '. \$dir/'\\\${base_file}'i;echo \\\$dlname'\\\`~
7790 dldir=\$destdir/\\\`dirname \\\$dlpath\\\`~
7791 test -d \\\$dldir || mkdir -p \\\$dldir~
7792 \$install_prog \$dir/\$dlname \\\$dldir/\$dlname~
7793 chmod a+x \\\$dldir/\$dlname"
7794 postuninstall_cmds="dldll=\\\`\$SHELL 2>&1 -c '. \$file; echo \\\$dlname'\\\`~
7795 dlpath=\$dir/\\\$dldll~
7796 \$rm \\\$dlpath"
7798 # Commands used to build a loadable module (assumed same as above if empty)
7799 module_cmds=""
7800 module_expsym_cmds=""
7802 # Commands to strip libraries.
7803 old_striplib="strip --strip-debug"
7804 striplib="strip --strip-unneeded"
7806 # Dependencies to place before the objects being linked to create a
7807 # shared library.
7808 predep_objects=""
7810 # Dependencies to place after the objects being linked to create a
7811 # shared library.
7812 postdep_objects=""
7814 # Dependencies to place before the objects being linked to create a
7815 # shared library.
7816 predeps=""
7818 # Dependencies to place after the objects being linked to create a
7819 # shared library.
7820 postdeps=""
7822 # The library search path used internally by the compiler when linking
7823 # a shared library.
7824 compiler_lib_search_path=""
7826 # Method to check whether dependent libraries are shared objects.
7827 deplibs_check_method="file_magic file format pei*-i386(.*architecture: i386)?"
7829 # Command to use when deplibs_check_method == file_magic.
7830 file_magic_cmd="\$OBJDUMP -f"
7832 # Flag that allows shared libraries with undefined symbols to be built.
7833 allow_undefined_flag="unsupported"
7835 # Flag that forces no undefined symbols.
7836 no_undefined_flag=""
7838 # Commands used to finish a libtool library installation in a directory.
7839 finish_cmds=""
7841 # Same as above, but a single script fragment to be evaled but not shown.
7842 finish_eval=""
7844 # Take the output of nm and produce a listing of raw symbols and C names.
7845 global_symbol_pipe=""
7847 # Transform the output of nm in a proper C declaration
7848 global_symbol_to_cdecl=""
7850 # Transform the output of nm in a C name address pair
7851 global_symbol_to_c_name_address=""
7853 # This is the shared library runtime path variable.
7854 runpath_var=LD_RUN_PATH
7856 # This is the shared library path variable.
7857 shlibpath_var=PATH
7859 # Is shlibpath searched before the hard-coded library search path?
7860 shlibpath_overrides_runpath=yes
7862 # How to hardcode a shared library path into an executable.
7863 hardcode_action=immediate
7865 # Whether we should hardcode library paths into libraries.
7866 hardcode_into_libs=no
7868 # Flag to hardcode $libdir into a binary during linking.
7869 # This must work even if $libdir does not exist.
7870 hardcode_libdir_flag_spec="-L\$libdir"
7872 # If ld is used when linking, flag to hardcode $libdir into
7873 # a binary during linking. This must work even if $libdir does
7874 # not exist.
7875 hardcode_libdir_flag_spec_ld=""
7877 # Whether we need a single -rpath flag with a separated argument.
7878 hardcode_libdir_separator=""
7880 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
7881 # resulting binary.
7882 hardcode_direct=no
7884 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
7885 # resulting binary.
7886 hardcode_minus_L=no
7888 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
7889 # the resulting binary.
7890 hardcode_shlibpath_var=unsupported
7892 # Set to yes if building a shared library automatically hardcodes DIR into the library
7893 # and all subsequent libraries and executables linked against it.
7894 hardcode_automatic=no
7896 # Variables whose values should be saved in libtool wrapper scripts and
7897 # restored at relink time.
7898 variables_saved_for_relink="PATH PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
7900 # Whether libtool must link a program against all its dependency libraries.
7901 link_all_deplibs=unknown
7903 # Compile-time system search path for libraries
7904 sys_lib_search_path_spec=" /bin/../lib/gcc-lib/i686-pc-msys/2.95.3-1/ /bin/../lib/gcc-lib/ /usr/lib/gcc-lib/i686-pc-msys/2.95.3-1/ /usr/lib/gcc/i686-pc-msys/2.95.3-1/ /bin/../lib/gcc-lib/i686-pc-msys/2.95.3-1/../../../../i686-pc-msys/lib/i686-pc-msys/2.95.3-1/ /bin/../lib/gcc-lib/i686-pc-msys/2.95.3-1/../../../../i686-pc-msys/lib/ /usr/lib/gcc-lib/i686-pc-msys/2.95.3-1/../../../../i686-pc-msys/lib/i686-pc-msys/2.95.3-1/ /usr/lib/gcc-lib/i686-pc-msys/2.95.3-1/../../../../i686-pc-msys/lib/"
7906 # Run-time system search path for libraries
7907 sys_lib_dlsearch_path_spec="/lib /usr/lib"
7909 # Fix the shell variable $srcfile for the compiler.
7910 fix_srcfile_path=""
7912 # Set to yes if exported symbols are required.
7913 always_export_symbols=no
7915 # The commands to list exported symbols.
7916 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED -e '/^[BCDGRS][ ]/s/.*[ ]\\\\([^ ]*\\\\)/\\\\1 DATA/' -e '/^[AITW][ ]/s/.*[ ]//' | sort | uniq > \$export_symbols"
7918 # The commands to extract the exported symbol list from a shared archive.
7919 extract_expsyms_cmds=""
7921 # Symbols that should not be listed in the preloaded symbols.
7922 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
7924 # Symbols that must always be exported.
7925 include_expsyms=""
7927 # ### END LIBTOOL TAG CONFIG: F77