Install Subversion 1.6.3
[msysgit.git] / build-1 / libtool
blob79c7df5617b359375b55da785eae2cd517d3038f
1 #! /bin/sh
3 # libtoolT - Provide generalized library-building support services.
4 # Generated automatically by (GNU )
5 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
7 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
8 # Free Software Foundation, Inc.
10 # This file is part of GNU Libtool:
11 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
13 # This program is free software; you can redistribute it and/or modify
14 # it under the terms of the GNU General Public License as published by
15 # the Free Software Foundation; either version 2 of the License, or
16 # (at your option) any later version.
18 # This program is distributed in the hope that it will be useful, but
19 # WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 # General Public License for more details.
23 # You should have received a copy of the GNU General Public License
24 # along with this program; if not, write to the Free Software
25 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27 # As a special exception to the GNU General Public License, if you
28 # distribute this file as part of a program that contains a
29 # configuration script generated by Autoconf, you may include it under
30 # the same distribution terms that you use for the rest of that program.
32 # A sed program that does not truncate output.
33 SED="/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 Felix-Maschine:
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=no
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-cygwin
70 host_os=cygwin
72 # The build system.
73 build_alias=i686-pc-cygwin
74 build=i686-pc-cygwin
75 build_os=cygwin
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=unknown
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="\`echo \${libname} | sed -e s/^lib/cyg/\`\`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 directories searched by this compiler when creating a shared
257 # library
258 compiler_lib_search_dirs=""
260 # The library search path used internally by the compiler when linking
261 # a shared library.
262 compiler_lib_search_path=""
264 # Method to check whether dependent libraries are shared objects.
265 deplibs_check_method=pass_all
267 # Command to use when deplibs_check_method == file_magic.
268 file_magic_cmd="\$OBJDUMP -f"
270 # Flag that allows shared libraries with undefined symbols to be built.
271 allow_undefined_flag="unsupported"
273 # Flag that forces no undefined symbols.
274 no_undefined_flag=""
276 # Commands used to finish a libtool library installation in a directory.
277 finish_cmds=""
279 # Same as above, but a single script fragment to be evaled but not shown.
280 finish_eval=""
282 # Take the output of nm and produce a listing of raw symbols and C names.
283 global_symbol_pipe=""
285 # Transform the output of nm in a proper C declaration
286 global_symbol_to_cdecl=""
288 # Transform the output of nm in a C name address pair
289 global_symbol_to_c_name_address=""
291 # This is the shared library runtime path variable.
292 runpath_var=LD_RUN_PATH
294 # This is the shared library path variable.
295 shlibpath_var=PATH
297 # Is shlibpath searched before the hard-coded library search path?
298 shlibpath_overrides_runpath=yes
300 # How to hardcode a shared library path into an executable.
301 hardcode_action=immediate
303 # Whether we should hardcode library paths into libraries.
304 hardcode_into_libs=no
306 # Flag to hardcode $libdir into a binary during linking.
307 # This must work even if $libdir does not exist.
308 hardcode_libdir_flag_spec="-L\$libdir"
310 # If ld is used when linking, flag to hardcode $libdir into
311 # a binary during linking. This must work even if $libdir does
312 # not exist.
313 hardcode_libdir_flag_spec_ld=""
315 # Whether we need a single -rpath flag with a separated argument.
316 hardcode_libdir_separator=""
318 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
319 # resulting binary.
320 hardcode_direct=no
322 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
323 # resulting binary.
324 hardcode_minus_L=no
326 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
327 # the resulting binary.
328 hardcode_shlibpath_var=unsupported
330 # Set to yes if building a shared library automatically hardcodes DIR into the library
331 # and all subsequent libraries and executables linked against it.
332 hardcode_automatic=no
334 # Variables whose values should be saved in libtool wrapper scripts and
335 # restored at relink time.
336 variables_saved_for_relink="PATH PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
338 # Whether libtool must link a program against all its dependency libraries.
339 link_all_deplibs=unknown
341 # Compile-time system search path for libraries
342 sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
344 # Run-time system search path for libraries
345 sys_lib_dlsearch_path_spec="/lib /usr/lib"
347 # Fix the shell variable $srcfile for the compiler.
348 fix_srcfile_path=""
350 # Set to yes if exported symbols are required.
351 always_export_symbols=no
353 # The commands to list exported symbols.
354 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED -e '/^[BCDGRS][ ]/s/.*[ ]\\\\([^ ]*\\\\)/\\\\1 DATA/' -e '/^[AITW][ ]/s/.*[ ]//' | sort | uniq > \$export_symbols"
356 # The commands to extract the exported symbol list from a shared archive.
357 extract_expsyms_cmds=""
359 # Symbols that should not be listed in the preloaded symbols.
360 exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
362 # Symbols that must always be exported.
363 include_expsyms=""
365 # ### END LIBTOOL CONFIG
367 # ltmain.sh - Provide generalized library-building support services.
368 # NOTE: Changing this file will not affect anything until you rerun configure.
370 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
371 # 2007, 2008 Free Software Foundation, Inc.
372 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
374 # This program is free software; you can redistribute it and/or modify
375 # it under the terms of the GNU General Public License as published by
376 # the Free Software Foundation; either version 2 of the License, or
377 # (at your option) any later version.
379 # This program is distributed in the hope that it will be useful, but
380 # WITHOUT ANY WARRANTY; without even the implied warranty of
381 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
382 # General Public License for more details.
384 # You should have received a copy of the GNU General Public License
385 # along with this program; if not, write to the Free Software
386 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
388 # As a special exception to the GNU General Public License, if you
389 # distribute this file as part of a program that contains a
390 # configuration script generated by Autoconf, you may include it under
391 # the same distribution terms that you use for the rest of that program.
393 basename="s,^.*/,,g"
395 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
396 # is ksh but when the shell is invoked as "sh" and the current value of
397 # the _XPG environment variable is not equal to 1 (one), the special
398 # positional parameter $0, within a function call, is the name of the
399 # function.
400 progpath="$0"
402 # The name of this program:
403 progname=`echo "$progpath" | $SED $basename`
404 modename="$progname"
406 # Global variables:
407 EXIT_SUCCESS=0
408 EXIT_FAILURE=1
410 PROGRAM=ltmain.sh
411 PACKAGE=libtool
412 VERSION=1.5.26
413 TIMESTAMP=" (1.1220.2.493 2008/02/01 16:58:18)"
415 # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
416 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
417 emulate sh
418 NULLCMD=:
419 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
420 # is contrary to our usage. Disable this feature.
421 alias -g '${1+"$@"}'='"$@"'
422 setopt NO_GLOB_SUBST
423 else
424 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
426 BIN_SH=xpg4; export BIN_SH # for Tru64
427 DUALCASE=1; export DUALCASE # for MKS sh
429 # Check that we have a working $echo.
430 if test "X$1" = X--no-reexec; then
431 # Discard the --no-reexec flag, and continue.
432 shift
433 elif test "X$1" = X--fallback-echo; then
434 # Avoid inline document here, it may be left over
436 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
437 # Yippee, $echo works!
439 else
440 # Restart under the correct shell, and then maybe $echo will work.
441 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
444 if test "X$1" = X--fallback-echo; then
445 # used as fallback echo
446 shift
447 cat <<EOF
450 exit $EXIT_SUCCESS
453 default_mode=
454 help="Try \`$progname --help' for more information."
455 magic="%%%MAGIC variable%%%"
456 mkdir="mkdir"
457 mv="mv -f"
458 rm="rm -f"
460 # Sed substitution that helps us do robust quoting. It backslashifies
461 # metacharacters that are still active within double-quoted strings.
462 Xsed="${SED}"' -e 1s/^X//'
463 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
464 # test EBCDIC or ASCII
465 case `echo X|tr X '\101'` in
466 A) # ASCII based system
467 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
468 SP2NL='tr \040 \012'
469 NL2SP='tr \015\012 \040\040'
471 *) # EBCDIC based system
472 SP2NL='tr \100 \n'
473 NL2SP='tr \r\n \100\100'
475 esac
477 # NLS nuisances.
478 # Only set LANG and LC_ALL to C if already set.
479 # These must not be set unconditionally because not all systems understand
480 # e.g. LANG=C (notably SCO).
481 # We save the old values to restore during execute mode.
482 lt_env=
483 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
485 eval "if test \"\${$lt_var+set}\" = set; then
486 save_$lt_var=\$$lt_var
487 lt_env=\"$lt_var=\$$lt_var \$lt_env\"
488 $lt_var=C
489 export $lt_var
491 done
493 if test -n "$lt_env"; then
494 lt_env="env $lt_env"
497 # Make sure IFS has a sensible default
498 lt_nl='
500 IFS=" $lt_nl"
502 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
503 $echo "$modename: not configured to build any kind of library" 1>&2
504 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
505 exit $EXIT_FAILURE
508 # Global variables.
509 mode=$default_mode
510 nonopt=
511 prev=
512 prevopt=
513 run=
514 show="$echo"
515 show_help=
516 execute_dlfiles=
517 duplicate_deps=no
518 preserve_args=
519 lo2o="s/\\.lo\$/.${objext}/"
520 o2lo="s/\\.${objext}\$/.lo/"
521 extracted_archives=
522 extracted_serial=0
524 #####################################
525 # Shell function definitions:
526 # This seems to be the best place for them
528 # func_mktempdir [string]
529 # Make a temporary directory that won't clash with other running
530 # libtool processes, and avoids race conditions if possible. If
531 # given, STRING is the basename for that directory.
532 func_mktempdir ()
534 my_template="${TMPDIR-/tmp}/${1-$progname}"
536 if test "$run" = ":"; then
537 # Return a directory name, but don't create it in dry-run mode
538 my_tmpdir="${my_template}-$$"
539 else
541 # If mktemp works, use that first and foremost
542 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
544 if test ! -d "$my_tmpdir"; then
545 # Failing that, at least try and use $RANDOM to avoid a race
546 my_tmpdir="${my_template}-${RANDOM-0}$$"
548 save_mktempdir_umask=`umask`
549 umask 0077
550 $mkdir "$my_tmpdir"
551 umask $save_mktempdir_umask
554 # If we're not in dry-run mode, bomb out on failure
555 test -d "$my_tmpdir" || {
556 $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
557 exit $EXIT_FAILURE
561 $echo "X$my_tmpdir" | $Xsed
565 # func_win32_libid arg
566 # return the library type of file 'arg'
568 # Need a lot of goo to handle *both* DLLs and import libs
569 # Has to be a shell function in order to 'eat' the argument
570 # that is supplied when $file_magic_command is called.
571 func_win32_libid ()
573 win32_libid_type="unknown"
574 win32_fileres=`file -L $1 2>/dev/null`
575 case $win32_fileres in
576 *ar\ archive\ import\ library*) # definitely import
577 win32_libid_type="x86 archive import"
579 *ar\ archive*) # could be an import, or static
580 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
581 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
582 win32_nmres=`eval $NM -f posix -A $1 | \
583 $SED -n -e '1,100{
584 / I /{
585 s,.*,import,
590 case $win32_nmres in
591 import*) win32_libid_type="x86 archive import";;
592 *) win32_libid_type="x86 archive static";;
593 esac
596 *DLL*)
597 win32_libid_type="x86 DLL"
599 *executable*) # but shell scripts are "executable" too...
600 case $win32_fileres in
601 *MS\ Windows\ PE\ Intel*)
602 win32_libid_type="x86 DLL"
604 esac
606 esac
607 $echo $win32_libid_type
611 # func_infer_tag arg
612 # Infer tagged configuration to use if any are available and
613 # if one wasn't chosen via the "--tag" command line option.
614 # Only attempt this if the compiler in the base compile
615 # command doesn't match the default compiler.
616 # arg is usually of the form 'gcc ...'
617 func_infer_tag ()
619 if test -n "$available_tags" && test -z "$tagname"; then
620 CC_quoted=
621 for arg in $CC; do
622 case $arg in
623 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
624 arg="\"$arg\""
626 esac
627 CC_quoted="$CC_quoted $arg"
628 done
629 case $@ in
630 # Blanks in the command may have been stripped by the calling shell,
631 # but not from the CC environment variable when configure was run.
632 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
633 # Blanks at the start of $base_compile will cause this to fail
634 # if we don't check for them as well.
636 for z in $available_tags; do
637 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
638 # Evaluate the configuration.
639 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
640 CC_quoted=
641 for arg in $CC; do
642 # Double-quote args containing other shell metacharacters.
643 case $arg in
644 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
645 arg="\"$arg\""
647 esac
648 CC_quoted="$CC_quoted $arg"
649 done
650 case "$@ " in
651 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
652 # The compiler in the base compile command matches
653 # the one in the tagged configuration.
654 # Assume this is the tagged configuration we want.
655 tagname=$z
656 break
658 esac
660 done
661 # If $tagname still isn't set, then no tagged configuration
662 # was found and let the user know that the "--tag" command
663 # line option must be used.
664 if test -z "$tagname"; then
665 $echo "$modename: unable to infer tagged configuration"
666 $echo "$modename: specify a tag with \`--tag'" 1>&2
667 exit $EXIT_FAILURE
668 # else
669 # $echo "$modename: using $tagname tagged configuration"
672 esac
677 # func_extract_an_archive dir oldlib
678 func_extract_an_archive ()
680 f_ex_an_ar_dir="$1"; shift
681 f_ex_an_ar_oldlib="$1"
683 $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
684 $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
685 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
687 else
688 $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
689 exit $EXIT_FAILURE
693 # func_extract_archives gentop oldlib ...
694 func_extract_archives ()
696 my_gentop="$1"; shift
697 my_oldlibs=${1+"$@"}
698 my_oldobjs=""
699 my_xlib=""
700 my_xabs=""
701 my_xdir=""
702 my_status=""
704 $show "${rm}r $my_gentop"
705 $run ${rm}r "$my_gentop"
706 $show "$mkdir $my_gentop"
707 $run $mkdir "$my_gentop"
708 my_status=$?
709 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
710 exit $my_status
713 for my_xlib in $my_oldlibs; do
714 # Extract the objects.
715 case $my_xlib in
716 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
717 *) my_xabs=`pwd`"/$my_xlib" ;;
718 esac
719 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
720 my_xlib_u=$my_xlib
721 while :; do
722 case " $extracted_archives " in
723 *" $my_xlib_u "*)
724 extracted_serial=`expr $extracted_serial + 1`
725 my_xlib_u=lt$extracted_serial-$my_xlib ;;
726 *) break ;;
727 esac
728 done
729 extracted_archives="$extracted_archives $my_xlib_u"
730 my_xdir="$my_gentop/$my_xlib_u"
732 $show "${rm}r $my_xdir"
733 $run ${rm}r "$my_xdir"
734 $show "$mkdir $my_xdir"
735 $run $mkdir "$my_xdir"
736 exit_status=$?
737 if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
738 exit $exit_status
740 case $host in
741 *-darwin*)
742 $show "Extracting $my_xabs"
743 # Do not bother doing anything if just a dry run
744 if test -z "$run"; then
745 darwin_orig_dir=`pwd`
746 cd $my_xdir || exit $?
747 darwin_archive=$my_xabs
748 darwin_curdir=`pwd`
749 darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
750 darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
751 if test -n "$darwin_arches"; then
752 darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
753 darwin_arch=
754 $show "$darwin_base_archive has multiple architectures $darwin_arches"
755 for darwin_arch in $darwin_arches ; do
756 mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
757 lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
758 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
759 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
760 cd "$darwin_curdir"
761 $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
762 done # $darwin_arches
763 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
764 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
765 darwin_file=
766 darwin_files=
767 for darwin_file in $darwin_filelist; do
768 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
769 lipo -create -output "$darwin_file" $darwin_files
770 done # $darwin_filelist
771 ${rm}r unfat-$$
772 cd "$darwin_orig_dir"
773 else
774 cd "$darwin_orig_dir"
775 func_extract_an_archive "$my_xdir" "$my_xabs"
776 fi # $darwin_arches
777 fi # $run
780 func_extract_an_archive "$my_xdir" "$my_xabs"
782 esac
783 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
784 done
785 func_extract_archives_result="$my_oldobjs"
787 # End of Shell function definitions
788 #####################################
790 # Darwin sucks
791 eval std_shrext=\"$shrext_cmds\"
793 disable_libs=no
795 # Parse our command line options once, thoroughly.
796 while test "$#" -gt 0
798 arg="$1"
799 shift
801 case $arg in
802 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
803 *) optarg= ;;
804 esac
806 # If the previous option needs an argument, assign it.
807 if test -n "$prev"; then
808 case $prev in
809 execute_dlfiles)
810 execute_dlfiles="$execute_dlfiles $arg"
812 tag)
813 tagname="$arg"
814 preserve_args="${preserve_args}=$arg"
816 # Check whether tagname contains only valid characters
817 case $tagname in
818 *[!-_A-Za-z0-9,/]*)
819 $echo "$progname: invalid tag name: $tagname" 1>&2
820 exit $EXIT_FAILURE
822 esac
824 case $tagname in
826 # Don't test for the "default" C tag, as we know, it's there, but
827 # not specially marked.
830 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
831 taglist="$taglist $tagname"
832 # Evaluate the configuration.
833 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
834 else
835 $echo "$progname: ignoring unknown tag $tagname" 1>&2
838 esac
841 eval "$prev=\$arg"
843 esac
845 prev=
846 prevopt=
847 continue
850 # Have we seen a non-optional argument yet?
851 case $arg in
852 --help)
853 show_help=yes
856 --version)
857 echo "\
858 $PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP
860 Copyright (C) 2008 Free Software Foundation, Inc.
861 This is free software; see the source for copying conditions. There is NO
862 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
863 exit $?
866 --config)
867 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
868 # Now print the configurations for the tags.
869 for tagname in $taglist; do
870 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
871 done
872 exit $?
875 --debug)
876 $echo "$progname: enabling shell trace mode"
877 set -x
878 preserve_args="$preserve_args $arg"
881 --dry-run | -n)
882 run=:
885 --features)
886 $echo "host: $host"
887 if test "$build_libtool_libs" = yes; then
888 $echo "enable shared libraries"
889 else
890 $echo "disable shared libraries"
892 if test "$build_old_libs" = yes; then
893 $echo "enable static libraries"
894 else
895 $echo "disable static libraries"
897 exit $?
900 --finish) mode="finish" ;;
902 --mode) prevopt="--mode" prev=mode ;;
903 --mode=*) mode="$optarg" ;;
905 --preserve-dup-deps) duplicate_deps="yes" ;;
907 --quiet | --silent)
908 show=:
909 preserve_args="$preserve_args $arg"
912 --tag)
913 prevopt="--tag"
914 prev=tag
915 preserve_args="$preserve_args --tag"
917 --tag=*)
918 set tag "$optarg" ${1+"$@"}
919 shift
920 prev=tag
921 preserve_args="$preserve_args --tag"
924 -dlopen)
925 prevopt="-dlopen"
926 prev=execute_dlfiles
930 $echo "$modename: unrecognized option \`$arg'" 1>&2
931 $echo "$help" 1>&2
932 exit $EXIT_FAILURE
936 nonopt="$arg"
937 break
939 esac
940 done
942 if test -n "$prevopt"; then
943 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
944 $echo "$help" 1>&2
945 exit $EXIT_FAILURE
948 case $disable_libs in
949 no)
951 shared)
952 build_libtool_libs=no
953 build_old_libs=yes
955 static)
956 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
958 esac
960 # If this variable is set in any of the actions, the command in it
961 # will be execed at the end. This prevents here-documents from being
962 # left over by shells.
963 exec_cmd=
965 if test -z "$show_help"; then
967 # Infer the operation mode.
968 if test -z "$mode"; then
969 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
970 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
971 case $nonopt in
972 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
973 mode=link
974 for arg
976 case $arg in
978 mode=compile
979 break
981 esac
982 done
984 *db | *dbx | *strace | *truss)
985 mode=execute
987 *install*|cp|mv)
988 mode=install
990 *rm)
991 mode=uninstall
994 # If we have no mode, but dlfiles were specified, then do execute mode.
995 test -n "$execute_dlfiles" && mode=execute
997 # Just use the default operation mode.
998 if test -z "$mode"; then
999 if test -n "$nonopt"; then
1000 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
1001 else
1002 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
1006 esac
1009 # Only execute mode is allowed to have -dlopen flags.
1010 if test -n "$execute_dlfiles" && test "$mode" != execute; then
1011 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
1012 $echo "$help" 1>&2
1013 exit $EXIT_FAILURE
1016 # Change the help message to a mode-specific one.
1017 generic_help="$help"
1018 help="Try \`$modename --help --mode=$mode' for more information."
1020 # These modes are in order of execution frequency so that they run quickly.
1021 case $mode in
1022 # libtool compile mode
1023 compile)
1024 modename="$modename: compile"
1025 # Get the compilation command and the source file.
1026 base_compile=
1027 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
1028 suppress_opt=yes
1029 suppress_output=
1030 arg_mode=normal
1031 libobj=
1032 later=
1034 for arg
1036 case $arg_mode in
1037 arg )
1038 # do not "continue". Instead, add this to base_compile
1039 lastarg="$arg"
1040 arg_mode=normal
1043 target )
1044 libobj="$arg"
1045 arg_mode=normal
1046 continue
1049 normal )
1050 # Accept any command-line options.
1051 case $arg in
1053 if test -n "$libobj" ; then
1054 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
1055 exit $EXIT_FAILURE
1057 arg_mode=target
1058 continue
1061 -static | -prefer-pic | -prefer-non-pic)
1062 later="$later $arg"
1063 continue
1066 -no-suppress)
1067 suppress_opt=no
1068 continue
1071 -Xcompiler)
1072 arg_mode=arg # the next one goes into the "base_compile" arg list
1073 continue # The current "srcfile" will either be retained or
1074 ;; # replaced later. I would guess that would be a bug.
1076 -Wc,*)
1077 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
1078 lastarg=
1079 save_ifs="$IFS"; IFS=','
1080 for arg in $args; do
1081 IFS="$save_ifs"
1083 # Double-quote args containing other shell metacharacters.
1084 # Many Bourne shells cannot handle close brackets correctly
1085 # in scan sets, so we specify it separately.
1086 case $arg in
1087 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1088 arg="\"$arg\""
1090 esac
1091 lastarg="$lastarg $arg"
1092 done
1093 IFS="$save_ifs"
1094 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
1096 # Add the arguments to base_compile.
1097 base_compile="$base_compile $lastarg"
1098 continue
1102 # Accept the current argument as the source file.
1103 # The previous "srcfile" becomes the current argument.
1105 lastarg="$srcfile"
1106 srcfile="$arg"
1108 esac # case $arg
1110 esac # case $arg_mode
1112 # Aesthetically quote the previous argument.
1113 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
1115 case $lastarg in
1116 # Double-quote args containing other shell metacharacters.
1117 # Many Bourne shells cannot handle close brackets correctly
1118 # in scan sets, and some SunOS ksh mistreat backslash-escaping
1119 # in scan sets (worked around with variable expansion),
1120 # and furthermore cannot handle '|' '&' '(' ')' in scan sets
1121 # at all, so we specify them separately.
1122 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1123 lastarg="\"$lastarg\""
1125 esac
1127 base_compile="$base_compile $lastarg"
1128 done # for arg
1130 case $arg_mode in
1131 arg)
1132 $echo "$modename: you must specify an argument for -Xcompile"
1133 exit $EXIT_FAILURE
1135 target)
1136 $echo "$modename: you must specify a target with \`-o'" 1>&2
1137 exit $EXIT_FAILURE
1140 # Get the name of the library object.
1141 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
1143 esac
1145 # Recognize several different file suffixes.
1146 # If the user specifies -o file.o, it is replaced with file.lo
1147 xform='[cCFSifmso]'
1148 case $libobj in
1149 *.ada) xform=ada ;;
1150 *.adb) xform=adb ;;
1151 *.ads) xform=ads ;;
1152 *.asm) xform=asm ;;
1153 *.c++) xform=c++ ;;
1154 *.cc) xform=cc ;;
1155 *.ii) xform=ii ;;
1156 *.class) xform=class ;;
1157 *.cpp) xform=cpp ;;
1158 *.cxx) xform=cxx ;;
1159 *.[fF][09]?) xform=[fF][09]. ;;
1160 *.for) xform=for ;;
1161 *.java) xform=java ;;
1162 *.obj) xform=obj ;;
1163 *.sx) xform=sx ;;
1164 esac
1166 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
1168 case $libobj in
1169 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
1171 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
1172 exit $EXIT_FAILURE
1174 esac
1176 func_infer_tag $base_compile
1178 for arg in $later; do
1179 case $arg in
1180 -static)
1181 build_old_libs=yes
1182 continue
1185 -prefer-pic)
1186 pic_mode=yes
1187 continue
1190 -prefer-non-pic)
1191 pic_mode=no
1192 continue
1194 esac
1195 done
1197 qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
1198 case $qlibobj in
1199 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1200 qlibobj="\"$qlibobj\"" ;;
1201 esac
1202 test "X$libobj" != "X$qlibobj" \
1203 && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
1204 && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
1205 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
1206 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
1207 if test "X$xdir" = "X$obj"; then
1208 xdir=
1209 else
1210 xdir=$xdir/
1212 lobj=${xdir}$objdir/$objname
1214 if test -z "$base_compile"; then
1215 $echo "$modename: you must specify a compilation command" 1>&2
1216 $echo "$help" 1>&2
1217 exit $EXIT_FAILURE
1220 # Delete any leftover library objects.
1221 if test "$build_old_libs" = yes; then
1222 removelist="$obj $lobj $libobj ${libobj}T"
1223 else
1224 removelist="$lobj $libobj ${libobj}T"
1227 $run $rm $removelist
1228 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1230 # On Cygwin there's no "real" PIC flag so we must build both object types
1231 case $host_os in
1232 cygwin* | mingw* | pw32* | os2*)
1233 pic_mode=default
1235 esac
1236 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
1237 # non-PIC code in shared libraries is not supported
1238 pic_mode=default
1241 # Calculate the filename of the output object if compiler does
1242 # not support -o with -c
1243 if test "$compiler_c_o" = no; then
1244 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
1245 lockfile="$output_obj.lock"
1246 removelist="$removelist $output_obj $lockfile"
1247 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1248 else
1249 output_obj=
1250 need_locks=no
1251 lockfile=
1254 # Lock this critical section if it is needed
1255 # We use this script file to make the link, it avoids creating a new file
1256 if test "$need_locks" = yes; then
1257 until $run ln "$progpath" "$lockfile" 2>/dev/null; do
1258 $show "Waiting for $lockfile to be removed"
1259 sleep 2
1260 done
1261 elif test "$need_locks" = warn; then
1262 if test -f "$lockfile"; then
1263 $echo "\
1264 *** ERROR, $lockfile exists and contains:
1265 `cat $lockfile 2>/dev/null`
1267 This indicates that another process is trying to use the same
1268 temporary object file, and libtool could not work around it because
1269 your compiler does not support \`-c' and \`-o' together. If you
1270 repeat this compilation, it may succeed, by chance, but you had better
1271 avoid parallel builds (make -j) in this platform, or get a better
1272 compiler."
1274 $run $rm $removelist
1275 exit $EXIT_FAILURE
1277 $echo "$srcfile" > "$lockfile"
1280 if test -n "$fix_srcfile_path"; then
1281 eval srcfile=\"$fix_srcfile_path\"
1283 qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
1284 case $qsrcfile in
1285 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1286 qsrcfile="\"$qsrcfile\"" ;;
1287 esac
1289 $run $rm "$libobj" "${libobj}T"
1291 # Create a libtool object file (analogous to a ".la" file),
1292 # but don't create it if we're doing a dry run.
1293 test -z "$run" && cat > ${libobj}T <<EOF
1294 # $libobj - a libtool object file
1295 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
1297 # Please DO NOT delete this file!
1298 # It is necessary for linking the library.
1300 # Name of the PIC object.
1303 # Only build a PIC object if we are building libtool libraries.
1304 if test "$build_libtool_libs" = yes; then
1305 # Without this assignment, base_compile gets emptied.
1306 fbsd_hideous_sh_bug=$base_compile
1308 if test "$pic_mode" != no; then
1309 command="$base_compile $qsrcfile $pic_flag"
1310 else
1311 # Don't build PIC code
1312 command="$base_compile $qsrcfile"
1315 if test ! -d "${xdir}$objdir"; then
1316 $show "$mkdir ${xdir}$objdir"
1317 $run $mkdir ${xdir}$objdir
1318 exit_status=$?
1319 if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
1320 exit $exit_status
1324 if test -z "$output_obj"; then
1325 # Place PIC objects in $objdir
1326 command="$command -o $lobj"
1329 $run $rm "$lobj" "$output_obj"
1331 $show "$command"
1332 if $run eval $lt_env "$command"; then :
1333 else
1334 test -n "$output_obj" && $run $rm $removelist
1335 exit $EXIT_FAILURE
1338 if test "$need_locks" = warn &&
1339 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1340 $echo "\
1341 *** ERROR, $lockfile contains:
1342 `cat $lockfile 2>/dev/null`
1344 but it should contain:
1345 $srcfile
1347 This indicates that another process is trying to use the same
1348 temporary object file, and libtool could not work around it because
1349 your compiler does not support \`-c' and \`-o' together. If you
1350 repeat this compilation, it may succeed, by chance, but you had better
1351 avoid parallel builds (make -j) in this platform, or get a better
1352 compiler."
1354 $run $rm $removelist
1355 exit $EXIT_FAILURE
1358 # Just move the object if needed, then go on to compile the next one
1359 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1360 $show "$mv $output_obj $lobj"
1361 if $run $mv $output_obj $lobj; then :
1362 else
1363 error=$?
1364 $run $rm $removelist
1365 exit $error
1369 # Append the name of the PIC object to the libtool object file.
1370 test -z "$run" && cat >> ${libobj}T <<EOF
1371 pic_object='$objdir/$objname'
1375 # Allow error messages only from the first compilation.
1376 if test "$suppress_opt" = yes; then
1377 suppress_output=' >/dev/null 2>&1'
1379 else
1380 # No PIC object so indicate it doesn't exist in the libtool
1381 # object file.
1382 test -z "$run" && cat >> ${libobj}T <<EOF
1383 pic_object=none
1388 # Only build a position-dependent object if we build old libraries.
1389 if test "$build_old_libs" = yes; then
1390 if test "$pic_mode" != yes; then
1391 # Don't build PIC code
1392 command="$base_compile $qsrcfile"
1393 else
1394 command="$base_compile $qsrcfile $pic_flag"
1396 if test "$compiler_c_o" = yes; then
1397 command="$command -o $obj"
1400 # Suppress compiler output if we already did a PIC compilation.
1401 command="$command$suppress_output"
1402 $run $rm "$obj" "$output_obj"
1403 $show "$command"
1404 if $run eval $lt_env "$command"; then :
1405 else
1406 $run $rm $removelist
1407 exit $EXIT_FAILURE
1410 if test "$need_locks" = warn &&
1411 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1412 $echo "\
1413 *** ERROR, $lockfile contains:
1414 `cat $lockfile 2>/dev/null`
1416 but it should contain:
1417 $srcfile
1419 This indicates that another process is trying to use the same
1420 temporary object file, and libtool could not work around it because
1421 your compiler does not support \`-c' and \`-o' together. If you
1422 repeat this compilation, it may succeed, by chance, but you had better
1423 avoid parallel builds (make -j) in this platform, or get a better
1424 compiler."
1426 $run $rm $removelist
1427 exit $EXIT_FAILURE
1430 # Just move the object if needed
1431 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1432 $show "$mv $output_obj $obj"
1433 if $run $mv $output_obj $obj; then :
1434 else
1435 error=$?
1436 $run $rm $removelist
1437 exit $error
1441 # Append the name of the non-PIC object the libtool object file.
1442 # Only append if the libtool object file exists.
1443 test -z "$run" && cat >> ${libobj}T <<EOF
1444 # Name of the non-PIC object.
1445 non_pic_object='$objname'
1448 else
1449 # Append the name of the non-PIC object the libtool object file.
1450 # Only append if the libtool object file exists.
1451 test -z "$run" && cat >> ${libobj}T <<EOF
1452 # Name of the non-PIC object.
1453 non_pic_object=none
1458 $run $mv "${libobj}T" "${libobj}"
1460 # Unlock the critical section if it was locked
1461 if test "$need_locks" != no; then
1462 $run $rm "$lockfile"
1465 exit $EXIT_SUCCESS
1468 # libtool link mode
1469 link | relink)
1470 modename="$modename: link"
1471 case $host in
1472 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1473 # It is impossible to link a dll without this setting, and
1474 # we shouldn't force the makefile maintainer to figure out
1475 # which system we are compiling for in order to pass an extra
1476 # flag for every libtool invocation.
1477 # allow_undefined=no
1479 # FIXME: Unfortunately, there are problems with the above when trying
1480 # to make a dll which has undefined symbols, in which case not
1481 # even a static library is built. For now, we need to specify
1482 # -no-undefined on the libtool link line when we can be certain
1483 # that all symbols are satisfied, otherwise we get a static library.
1484 allow_undefined=yes
1487 allow_undefined=yes
1489 esac
1490 libtool_args="$nonopt"
1491 base_compile="$nonopt $@"
1492 compile_command="$nonopt"
1493 finalize_command="$nonopt"
1495 compile_rpath=
1496 finalize_rpath=
1497 compile_shlibpath=
1498 finalize_shlibpath=
1499 convenience=
1500 old_convenience=
1501 deplibs=
1502 old_deplibs=
1503 compiler_flags=
1504 linker_flags=
1505 dllsearchpath=
1506 lib_search_path=`pwd`
1507 inst_prefix_dir=
1509 avoid_version=no
1510 dlfiles=
1511 dlprefiles=
1512 dlself=no
1513 export_dynamic=no
1514 export_symbols=
1515 export_symbols_regex=
1516 generated=
1517 libobjs=
1518 ltlibs=
1519 module=no
1520 no_install=no
1521 objs=
1522 non_pic_objects=
1523 notinst_path= # paths that contain not-installed libtool libraries
1524 precious_files_regex=
1525 prefer_static_libs=no
1526 preload=no
1527 prev=
1528 prevarg=
1529 release=
1530 rpath=
1531 xrpath=
1532 perm_rpath=
1533 temp_rpath=
1534 thread_safe=no
1535 vinfo=
1536 vinfo_number=no
1537 single_module="${wl}-single_module"
1539 func_infer_tag $base_compile
1541 # We need to know -static, to get the right output filenames.
1542 for arg
1544 case $arg in
1545 -all-static | -static | -static-libtool-libs)
1546 case $arg in
1547 -all-static)
1548 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1549 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1551 if test -n "$link_static_flag"; then
1552 dlopen_self=$dlopen_self_static
1554 prefer_static_libs=yes
1556 -static)
1557 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1558 dlopen_self=$dlopen_self_static
1560 prefer_static_libs=built
1562 -static-libtool-libs)
1563 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1564 dlopen_self=$dlopen_self_static
1566 prefer_static_libs=yes
1568 esac
1569 build_libtool_libs=no
1570 build_old_libs=yes
1571 break
1573 esac
1574 done
1576 # See if our shared archives depend on static archives.
1577 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1579 # Go through the arguments, transforming them on the way.
1580 while test "$#" -gt 0; do
1581 arg="$1"
1582 shift
1583 case $arg in
1584 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1585 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1587 *) qarg=$arg ;;
1588 esac
1589 libtool_args="$libtool_args $qarg"
1591 # If the previous option needs an argument, assign it.
1592 if test -n "$prev"; then
1593 case $prev in
1594 output)
1595 compile_command="$compile_command @OUTPUT@"
1596 finalize_command="$finalize_command @OUTPUT@"
1598 esac
1600 case $prev in
1601 dlfiles|dlprefiles)
1602 if test "$preload" = no; then
1603 # Add the symbol object into the linking commands.
1604 compile_command="$compile_command @SYMFILE@"
1605 finalize_command="$finalize_command @SYMFILE@"
1606 preload=yes
1608 case $arg in
1609 *.la | *.lo) ;; # We handle these cases below.
1610 force)
1611 if test "$dlself" = no; then
1612 dlself=needless
1613 export_dynamic=yes
1615 prev=
1616 continue
1618 self)
1619 if test "$prev" = dlprefiles; then
1620 dlself=yes
1621 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1622 dlself=yes
1623 else
1624 dlself=needless
1625 export_dynamic=yes
1627 prev=
1628 continue
1631 if test "$prev" = dlfiles; then
1632 dlfiles="$dlfiles $arg"
1633 else
1634 dlprefiles="$dlprefiles $arg"
1636 prev=
1637 continue
1639 esac
1641 expsyms)
1642 export_symbols="$arg"
1643 if test ! -f "$arg"; then
1644 $echo "$modename: symbol file \`$arg' does not exist"
1645 exit $EXIT_FAILURE
1647 prev=
1648 continue
1650 expsyms_regex)
1651 export_symbols_regex="$arg"
1652 prev=
1653 continue
1655 inst_prefix)
1656 inst_prefix_dir="$arg"
1657 prev=
1658 continue
1660 precious_regex)
1661 precious_files_regex="$arg"
1662 prev=
1663 continue
1665 release)
1666 release="-$arg"
1667 prev=
1668 continue
1670 objectlist)
1671 if test -f "$arg"; then
1672 save_arg=$arg
1673 moreargs=
1674 for fil in `cat $save_arg`
1676 # moreargs="$moreargs $fil"
1677 arg=$fil
1678 # A libtool-controlled object.
1680 # Check to see that this really is a libtool object.
1681 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1682 pic_object=
1683 non_pic_object=
1685 # Read the .lo file
1686 # If there is no directory component, then add one.
1687 case $arg in
1688 */* | *\\*) . $arg ;;
1689 *) . ./$arg ;;
1690 esac
1692 if test -z "$pic_object" || \
1693 test -z "$non_pic_object" ||
1694 test "$pic_object" = none && \
1695 test "$non_pic_object" = none; then
1696 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1697 exit $EXIT_FAILURE
1700 # Extract subdirectory from the argument.
1701 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1702 if test "X$xdir" = "X$arg"; then
1703 xdir=
1704 else
1705 xdir="$xdir/"
1708 if test "$pic_object" != none; then
1709 # Prepend the subdirectory the object is found in.
1710 pic_object="$xdir$pic_object"
1712 if test "$prev" = dlfiles; then
1713 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1714 dlfiles="$dlfiles $pic_object"
1715 prev=
1716 continue
1717 else
1718 # If libtool objects are unsupported, then we need to preload.
1719 prev=dlprefiles
1723 # CHECK ME: I think I busted this. -Ossama
1724 if test "$prev" = dlprefiles; then
1725 # Preload the old-style object.
1726 dlprefiles="$dlprefiles $pic_object"
1727 prev=
1730 # A PIC object.
1731 libobjs="$libobjs $pic_object"
1732 arg="$pic_object"
1735 # Non-PIC object.
1736 if test "$non_pic_object" != none; then
1737 # Prepend the subdirectory the object is found in.
1738 non_pic_object="$xdir$non_pic_object"
1740 # A standard non-PIC object
1741 non_pic_objects="$non_pic_objects $non_pic_object"
1742 if test -z "$pic_object" || test "$pic_object" = none ; then
1743 arg="$non_pic_object"
1745 else
1746 # If the PIC object exists, use it instead.
1747 # $xdir was prepended to $pic_object above.
1748 non_pic_object="$pic_object"
1749 non_pic_objects="$non_pic_objects $non_pic_object"
1751 else
1752 # Only an error if not doing a dry-run.
1753 if test -z "$run"; then
1754 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1755 exit $EXIT_FAILURE
1756 else
1757 # Dry-run case.
1759 # Extract subdirectory from the argument.
1760 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1761 if test "X$xdir" = "X$arg"; then
1762 xdir=
1763 else
1764 xdir="$xdir/"
1767 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1768 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1769 libobjs="$libobjs $pic_object"
1770 non_pic_objects="$non_pic_objects $non_pic_object"
1773 done
1774 else
1775 $echo "$modename: link input file \`$save_arg' does not exist"
1776 exit $EXIT_FAILURE
1778 arg=$save_arg
1779 prev=
1780 continue
1782 rpath | xrpath)
1783 # We need an absolute path.
1784 case $arg in
1785 [\\/]* | [A-Za-z]:[\\/]*) ;;
1787 $echo "$modename: only absolute run-paths are allowed" 1>&2
1788 exit $EXIT_FAILURE
1790 esac
1791 if test "$prev" = rpath; then
1792 case "$rpath " in
1793 *" $arg "*) ;;
1794 *) rpath="$rpath $arg" ;;
1795 esac
1796 else
1797 case "$xrpath " in
1798 *" $arg "*) ;;
1799 *) xrpath="$xrpath $arg" ;;
1800 esac
1802 prev=
1803 continue
1805 xcompiler)
1806 compiler_flags="$compiler_flags $qarg"
1807 prev=
1808 compile_command="$compile_command $qarg"
1809 finalize_command="$finalize_command $qarg"
1810 continue
1812 xlinker)
1813 linker_flags="$linker_flags $qarg"
1814 compiler_flags="$compiler_flags $wl$qarg"
1815 prev=
1816 compile_command="$compile_command $wl$qarg"
1817 finalize_command="$finalize_command $wl$qarg"
1818 continue
1820 xcclinker)
1821 linker_flags="$linker_flags $qarg"
1822 compiler_flags="$compiler_flags $qarg"
1823 prev=
1824 compile_command="$compile_command $qarg"
1825 finalize_command="$finalize_command $qarg"
1826 continue
1828 shrext)
1829 shrext_cmds="$arg"
1830 prev=
1831 continue
1833 darwin_framework|darwin_framework_skip)
1834 test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
1835 compile_command="$compile_command $arg"
1836 finalize_command="$finalize_command $arg"
1837 prev=
1838 continue
1841 eval "$prev=\"\$arg\""
1842 prev=
1843 continue
1845 esac
1846 fi # test -n "$prev"
1848 prevarg="$arg"
1850 case $arg in
1851 -all-static)
1852 if test -n "$link_static_flag"; then
1853 compile_command="$compile_command $link_static_flag"
1854 finalize_command="$finalize_command $link_static_flag"
1856 continue
1859 -allow-undefined)
1860 # FIXME: remove this flag sometime in the future.
1861 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1862 continue
1865 -avoid-version)
1866 avoid_version=yes
1867 continue
1870 -dlopen)
1871 prev=dlfiles
1872 continue
1875 -dlpreopen)
1876 prev=dlprefiles
1877 continue
1880 -export-dynamic)
1881 export_dynamic=yes
1882 continue
1885 -export-symbols | -export-symbols-regex)
1886 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1887 $echo "$modename: more than one -exported-symbols argument is not allowed"
1888 exit $EXIT_FAILURE
1890 if test "X$arg" = "X-export-symbols"; then
1891 prev=expsyms
1892 else
1893 prev=expsyms_regex
1895 continue
1898 -framework|-arch|-isysroot)
1899 case " $CC " in
1900 *" ${arg} ${1} "* | *" ${arg} ${1} "*)
1901 prev=darwin_framework_skip ;;
1902 *) compiler_flags="$compiler_flags $arg"
1903 prev=darwin_framework ;;
1904 esac
1905 compile_command="$compile_command $arg"
1906 finalize_command="$finalize_command $arg"
1907 continue
1910 -inst-prefix-dir)
1911 prev=inst_prefix
1912 continue
1915 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1916 # so, if we see these flags be careful not to treat them like -L
1917 -L[A-Z][A-Z]*:*)
1918 case $with_gcc/$host in
1919 no/*-*-irix* | /*-*-irix*)
1920 compile_command="$compile_command $arg"
1921 finalize_command="$finalize_command $arg"
1923 esac
1924 continue
1927 -L*)
1928 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1929 # We need an absolute path.
1930 case $dir in
1931 [\\/]* | [A-Za-z]:[\\/]*) ;;
1933 absdir=`cd "$dir" && pwd`
1934 if test -z "$absdir"; then
1935 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1936 absdir="$dir"
1937 notinst_path="$notinst_path $dir"
1939 dir="$absdir"
1941 esac
1942 case "$deplibs " in
1943 *" -L$dir "*) ;;
1945 deplibs="$deplibs -L$dir"
1946 lib_search_path="$lib_search_path $dir"
1948 esac
1949 case $host in
1950 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1951 testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1952 case :$dllsearchpath: in
1953 *":$dir:"*) ;;
1954 *) dllsearchpath="$dllsearchpath:$dir";;
1955 esac
1956 case :$dllsearchpath: in
1957 *":$testbindir:"*) ;;
1958 *) dllsearchpath="$dllsearchpath:$testbindir";;
1959 esac
1961 esac
1962 continue
1965 -l*)
1966 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1967 case $host in
1968 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
1969 # These systems don't actually have a C or math library (as such)
1970 continue
1972 *-*-os2*)
1973 # These systems don't actually have a C library (as such)
1974 test "X$arg" = "X-lc" && continue
1976 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1977 # Do not include libc due to us having libc/libc_r.
1978 test "X$arg" = "X-lc" && continue
1980 *-*-rhapsody* | *-*-darwin1.[012])
1981 # Rhapsody C and math libraries are in the System framework
1982 deplibs="$deplibs -framework System"
1983 continue
1985 *-*-sco3.2v5* | *-*-sco5v6*)
1986 # Causes problems with __ctype
1987 test "X$arg" = "X-lc" && continue
1989 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
1990 # Compiler inserts libc in the correct place for threads to work
1991 test "X$arg" = "X-lc" && continue
1993 esac
1994 elif test "X$arg" = "X-lc_r"; then
1995 case $host in
1996 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1997 # Do not include libc_r directly, use -pthread flag.
1998 continue
2000 esac
2002 deplibs="$deplibs $arg"
2003 continue
2006 # Tru64 UNIX uses -model [arg] to determine the layout of C++
2007 # classes, name mangling, and exception handling.
2008 -model)
2009 compile_command="$compile_command $arg"
2010 compiler_flags="$compiler_flags $arg"
2011 finalize_command="$finalize_command $arg"
2012 prev=xcompiler
2013 continue
2016 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
2017 compiler_flags="$compiler_flags $arg"
2018 compile_command="$compile_command $arg"
2019 finalize_command="$finalize_command $arg"
2020 continue
2023 -multi_module)
2024 single_module="${wl}-multi_module"
2025 continue
2028 -module)
2029 module=yes
2030 continue
2033 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
2034 # -r[0-9][0-9]* specifies the processor on the SGI compiler
2035 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
2036 # +DA*, +DD* enable 64-bit mode on the HP compiler
2037 # -q* pass through compiler args for the IBM compiler
2038 # -m* pass through architecture-specific compiler args for GCC
2039 # -m*, -t[45]*, -txscale* pass through architecture-specific
2040 # compiler args for GCC
2041 # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
2042 # -F/path gives path to uninstalled frameworks, gcc on darwin
2043 # @file GCC response files
2044 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
2045 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
2047 # Unknown arguments in both finalize_command and compile_command need
2048 # to be aesthetically quoted because they are evaled later.
2049 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2050 case $arg in
2051 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2052 arg="\"$arg\""
2054 esac
2055 compile_command="$compile_command $arg"
2056 finalize_command="$finalize_command $arg"
2057 compiler_flags="$compiler_flags $arg"
2058 continue
2061 -shrext)
2062 prev=shrext
2063 continue
2066 -no-fast-install)
2067 fast_install=no
2068 continue
2071 -no-install)
2072 case $host in
2073 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
2074 # The PATH hackery in wrapper scripts is required on Windows
2075 # and Darwin in order for the loader to find any dlls it needs.
2076 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
2077 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
2078 fast_install=no
2080 *) no_install=yes ;;
2081 esac
2082 continue
2085 -no-undefined)
2086 allow_undefined=no
2087 continue
2090 -objectlist)
2091 prev=objectlist
2092 continue
2095 -o) prev=output ;;
2097 -precious-files-regex)
2098 prev=precious_regex
2099 continue
2102 -release)
2103 prev=release
2104 continue
2107 -rpath)
2108 prev=rpath
2109 continue
2113 prev=xrpath
2114 continue
2117 -R*)
2118 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
2119 # We need an absolute path.
2120 case $dir in
2121 [\\/]* | [A-Za-z]:[\\/]*) ;;
2123 $echo "$modename: only absolute run-paths are allowed" 1>&2
2124 exit $EXIT_FAILURE
2126 esac
2127 case "$xrpath " in
2128 *" $dir "*) ;;
2129 *) xrpath="$xrpath $dir" ;;
2130 esac
2131 continue
2134 -static | -static-libtool-libs)
2135 # The effects of -static are defined in a previous loop.
2136 # We used to do the same as -all-static on platforms that
2137 # didn't have a PIC flag, but the assumption that the effects
2138 # would be equivalent was wrong. It would break on at least
2139 # Digital Unix and AIX.
2140 continue
2143 -thread-safe)
2144 thread_safe=yes
2145 continue
2148 -version-info)
2149 prev=vinfo
2150 continue
2152 -version-number)
2153 prev=vinfo
2154 vinfo_number=yes
2155 continue
2158 -Wc,*)
2159 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
2160 arg=
2161 save_ifs="$IFS"; IFS=','
2162 for flag in $args; do
2163 IFS="$save_ifs"
2164 case $flag in
2165 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2166 flag="\"$flag\""
2168 esac
2169 arg="$arg $wl$flag"
2170 compiler_flags="$compiler_flags $flag"
2171 done
2172 IFS="$save_ifs"
2173 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
2176 -Wl,*)
2177 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
2178 arg=
2179 save_ifs="$IFS"; IFS=','
2180 for flag in $args; do
2181 IFS="$save_ifs"
2182 case $flag in
2183 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2184 flag="\"$flag\""
2186 esac
2187 arg="$arg $wl$flag"
2188 compiler_flags="$compiler_flags $wl$flag"
2189 linker_flags="$linker_flags $flag"
2190 done
2191 IFS="$save_ifs"
2192 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
2195 -Xcompiler)
2196 prev=xcompiler
2197 continue
2200 -Xlinker)
2201 prev=xlinker
2202 continue
2205 -XCClinker)
2206 prev=xcclinker
2207 continue
2210 # Some other compiler flag.
2211 -* | +*)
2212 # Unknown arguments in both finalize_command and compile_command need
2213 # to be aesthetically quoted because they are evaled later.
2214 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2215 case $arg in
2216 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2217 arg="\"$arg\""
2219 esac
2222 *.$objext)
2223 # A standard object.
2224 objs="$objs $arg"
2227 *.lo)
2228 # A libtool-controlled object.
2230 # Check to see that this really is a libtool object.
2231 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2232 pic_object=
2233 non_pic_object=
2235 # Read the .lo file
2236 # If there is no directory component, then add one.
2237 case $arg in
2238 */* | *\\*) . $arg ;;
2239 *) . ./$arg ;;
2240 esac
2242 if test -z "$pic_object" || \
2243 test -z "$non_pic_object" ||
2244 test "$pic_object" = none && \
2245 test "$non_pic_object" = none; then
2246 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
2247 exit $EXIT_FAILURE
2250 # Extract subdirectory from the argument.
2251 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2252 if test "X$xdir" = "X$arg"; then
2253 xdir=
2254 else
2255 xdir="$xdir/"
2258 if test "$pic_object" != none; then
2259 # Prepend the subdirectory the object is found in.
2260 pic_object="$xdir$pic_object"
2262 if test "$prev" = dlfiles; then
2263 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
2264 dlfiles="$dlfiles $pic_object"
2265 prev=
2266 continue
2267 else
2268 # If libtool objects are unsupported, then we need to preload.
2269 prev=dlprefiles
2273 # CHECK ME: I think I busted this. -Ossama
2274 if test "$prev" = dlprefiles; then
2275 # Preload the old-style object.
2276 dlprefiles="$dlprefiles $pic_object"
2277 prev=
2280 # A PIC object.
2281 libobjs="$libobjs $pic_object"
2282 arg="$pic_object"
2285 # Non-PIC object.
2286 if test "$non_pic_object" != none; then
2287 # Prepend the subdirectory the object is found in.
2288 non_pic_object="$xdir$non_pic_object"
2290 # A standard non-PIC object
2291 non_pic_objects="$non_pic_objects $non_pic_object"
2292 if test -z "$pic_object" || test "$pic_object" = none ; then
2293 arg="$non_pic_object"
2295 else
2296 # If the PIC object exists, use it instead.
2297 # $xdir was prepended to $pic_object above.
2298 non_pic_object="$pic_object"
2299 non_pic_objects="$non_pic_objects $non_pic_object"
2301 else
2302 # Only an error if not doing a dry-run.
2303 if test -z "$run"; then
2304 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
2305 exit $EXIT_FAILURE
2306 else
2307 # Dry-run case.
2309 # Extract subdirectory from the argument.
2310 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2311 if test "X$xdir" = "X$arg"; then
2312 xdir=
2313 else
2314 xdir="$xdir/"
2317 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
2318 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
2319 libobjs="$libobjs $pic_object"
2320 non_pic_objects="$non_pic_objects $non_pic_object"
2325 *.$libext)
2326 # An archive.
2327 deplibs="$deplibs $arg"
2328 old_deplibs="$old_deplibs $arg"
2329 continue
2332 *.la)
2333 # A libtool-controlled library.
2335 if test "$prev" = dlfiles; then
2336 # This library was specified with -dlopen.
2337 dlfiles="$dlfiles $arg"
2338 prev=
2339 elif test "$prev" = dlprefiles; then
2340 # The library was specified with -dlpreopen.
2341 dlprefiles="$dlprefiles $arg"
2342 prev=
2343 else
2344 deplibs="$deplibs $arg"
2346 continue
2349 # Some other compiler argument.
2351 # Unknown arguments in both finalize_command and compile_command need
2352 # to be aesthetically quoted because they are evaled later.
2353 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2354 case $arg in
2355 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2356 arg="\"$arg\""
2358 esac
2360 esac # arg
2362 # Now actually substitute the argument into the commands.
2363 if test -n "$arg"; then
2364 compile_command="$compile_command $arg"
2365 finalize_command="$finalize_command $arg"
2367 done # argument parsing loop
2369 if test -n "$prev"; then
2370 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
2371 $echo "$help" 1>&2
2372 exit $EXIT_FAILURE
2375 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
2376 eval arg=\"$export_dynamic_flag_spec\"
2377 compile_command="$compile_command $arg"
2378 finalize_command="$finalize_command $arg"
2381 oldlibs=
2382 # calculate the name of the file, without its directory
2383 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
2384 libobjs_save="$libobjs"
2386 if test -n "$shlibpath_var"; then
2387 # get the directories listed in $shlibpath_var
2388 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2389 else
2390 shlib_search_path=
2392 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
2393 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
2395 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2396 if test "X$output_objdir" = "X$output"; then
2397 output_objdir="$objdir"
2398 else
2399 output_objdir="$output_objdir/$objdir"
2401 # Create the object directory.
2402 if test ! -d "$output_objdir"; then
2403 $show "$mkdir $output_objdir"
2404 $run $mkdir $output_objdir
2405 exit_status=$?
2406 if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
2407 exit $exit_status
2411 # Determine the type of output
2412 case $output in
2414 $echo "$modename: you must specify an output file" 1>&2
2415 $echo "$help" 1>&2
2416 exit $EXIT_FAILURE
2418 *.$libext) linkmode=oldlib ;;
2419 *.lo | *.$objext) linkmode=obj ;;
2420 *.la) linkmode=lib ;;
2421 *) linkmode=prog ;; # Anything else should be a program.
2422 esac
2424 case $host in
2425 *cygwin* | *mingw* | *pw32*)
2426 # don't eliminate duplications in $postdeps and $predeps
2427 duplicate_compiler_generated_deps=yes
2430 duplicate_compiler_generated_deps=$duplicate_deps
2432 esac
2433 specialdeplibs=
2435 libs=
2436 # Find all interdependent deplibs by searching for libraries
2437 # that are linked more than once (e.g. -la -lb -la)
2438 for deplib in $deplibs; do
2439 if test "X$duplicate_deps" = "Xyes" ; then
2440 case "$libs " in
2441 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2442 esac
2444 libs="$libs $deplib"
2445 done
2447 if test "$linkmode" = lib; then
2448 libs="$predeps $libs $compiler_lib_search_path $postdeps"
2450 # Compute libraries that are listed more than once in $predeps
2451 # $postdeps and mark them as special (i.e., whose duplicates are
2452 # not to be eliminated).
2453 pre_post_deps=
2454 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2455 for pre_post_dep in $predeps $postdeps; do
2456 case "$pre_post_deps " in
2457 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
2458 esac
2459 pre_post_deps="$pre_post_deps $pre_post_dep"
2460 done
2462 pre_post_deps=
2465 deplibs=
2466 newdependency_libs=
2467 newlib_search_path=
2468 need_relink=no # whether we're linking any uninstalled libtool libraries
2469 notinst_deplibs= # not-installed libtool libraries
2470 case $linkmode in
2471 lib)
2472 passes="conv link"
2473 for file in $dlfiles $dlprefiles; do
2474 case $file in
2475 *.la) ;;
2477 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2478 exit $EXIT_FAILURE
2480 esac
2481 done
2483 prog)
2484 compile_deplibs=
2485 finalize_deplibs=
2486 alldeplibs=no
2487 newdlfiles=
2488 newdlprefiles=
2489 passes="conv scan dlopen dlpreopen link"
2491 *) passes="conv"
2493 esac
2494 for pass in $passes; do
2495 if test "$linkmode,$pass" = "lib,link" ||
2496 test "$linkmode,$pass" = "prog,scan"; then
2497 libs="$deplibs"
2498 deplibs=
2500 if test "$linkmode" = prog; then
2501 case $pass in
2502 dlopen) libs="$dlfiles" ;;
2503 dlpreopen) libs="$dlprefiles" ;;
2504 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2505 esac
2507 if test "$pass" = dlopen; then
2508 # Collect dlpreopened libraries
2509 save_deplibs="$deplibs"
2510 deplibs=
2512 for deplib in $libs; do
2513 lib=
2514 found=no
2515 case $deplib in
2516 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
2517 if test "$linkmode,$pass" = "prog,link"; then
2518 compile_deplibs="$deplib $compile_deplibs"
2519 finalize_deplibs="$deplib $finalize_deplibs"
2520 else
2521 compiler_flags="$compiler_flags $deplib"
2523 continue
2525 -l*)
2526 if test "$linkmode" != lib && test "$linkmode" != prog; then
2527 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2528 continue
2530 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2531 if test "$linkmode" = lib; then
2532 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
2533 else
2534 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
2536 for searchdir in $searchdirs; do
2537 for search_ext in .la $std_shrext .so .a; do
2538 # Search the libtool library
2539 lib="$searchdir/lib${name}${search_ext}"
2540 if test -f "$lib"; then
2541 if test "$search_ext" = ".la"; then
2542 found=yes
2543 else
2544 found=no
2546 break 2
2548 done
2549 done
2550 if test "$found" != yes; then
2551 # deplib doesn't seem to be a libtool library
2552 if test "$linkmode,$pass" = "prog,link"; then
2553 compile_deplibs="$deplib $compile_deplibs"
2554 finalize_deplibs="$deplib $finalize_deplibs"
2555 else
2556 deplibs="$deplib $deplibs"
2557 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2559 continue
2560 else # deplib is a libtool library
2561 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2562 # We need to do some special things here, and not later.
2563 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2564 case " $predeps $postdeps " in
2565 *" $deplib "*)
2566 if (${SED} -e '2q' $lib |
2567 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2568 library_names=
2569 old_library=
2570 case $lib in
2571 */* | *\\*) . $lib ;;
2572 *) . ./$lib ;;
2573 esac
2574 for l in $old_library $library_names; do
2575 ll="$l"
2576 done
2577 if test "X$ll" = "X$old_library" ; then # only static version available
2578 found=no
2579 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2580 test "X$ladir" = "X$lib" && ladir="."
2581 lib=$ladir/$old_library
2582 if test "$linkmode,$pass" = "prog,link"; then
2583 compile_deplibs="$deplib $compile_deplibs"
2584 finalize_deplibs="$deplib $finalize_deplibs"
2585 else
2586 deplibs="$deplib $deplibs"
2587 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2589 continue
2593 *) ;;
2594 esac
2597 ;; # -l
2598 -L*)
2599 case $linkmode in
2600 lib)
2601 deplibs="$deplib $deplibs"
2602 test "$pass" = conv && continue
2603 newdependency_libs="$deplib $newdependency_libs"
2604 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2606 prog)
2607 if test "$pass" = conv; then
2608 deplibs="$deplib $deplibs"
2609 continue
2611 if test "$pass" = scan; then
2612 deplibs="$deplib $deplibs"
2613 else
2614 compile_deplibs="$deplib $compile_deplibs"
2615 finalize_deplibs="$deplib $finalize_deplibs"
2617 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2620 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2622 esac # linkmode
2623 continue
2624 ;; # -L
2625 -R*)
2626 if test "$pass" = link; then
2627 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2628 # Make sure the xrpath contains only unique directories.
2629 case "$xrpath " in
2630 *" $dir "*) ;;
2631 *) xrpath="$xrpath $dir" ;;
2632 esac
2634 deplibs="$deplib $deplibs"
2635 continue
2637 *.la) lib="$deplib" ;;
2638 *.$libext)
2639 if test "$pass" = conv; then
2640 deplibs="$deplib $deplibs"
2641 continue
2643 case $linkmode in
2644 lib)
2645 valid_a_lib=no
2646 case $deplibs_check_method in
2647 match_pattern*)
2648 set dummy $deplibs_check_method
2649 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2650 if eval $echo \"$deplib\" 2>/dev/null \
2651 | $SED 10q \
2652 | $EGREP "$match_pattern_regex" > /dev/null; then
2653 valid_a_lib=yes
2656 pass_all)
2657 valid_a_lib=yes
2659 esac
2660 if test "$valid_a_lib" != yes; then
2661 $echo
2662 $echo "*** Warning: Trying to link with static lib archive $deplib."
2663 $echo "*** I have the capability to make that library automatically link in when"
2664 $echo "*** you link to this library. But I can only do this if you have a"
2665 $echo "*** shared version of the library, which you do not appear to have"
2666 $echo "*** because the file extensions .$libext of this argument makes me believe"
2667 $echo "*** that it is just a static archive that I should not used here."
2668 else
2669 $echo
2670 $echo "*** Warning: Linking the shared library $output against the"
2671 $echo "*** static library $deplib is not portable!"
2672 deplibs="$deplib $deplibs"
2674 continue
2676 prog)
2677 if test "$pass" != link; then
2678 deplibs="$deplib $deplibs"
2679 else
2680 compile_deplibs="$deplib $compile_deplibs"
2681 finalize_deplibs="$deplib $finalize_deplibs"
2683 continue
2685 esac # linkmode
2686 ;; # *.$libext
2687 *.lo | *.$objext)
2688 if test "$pass" = conv; then
2689 deplibs="$deplib $deplibs"
2690 elif test "$linkmode" = prog; then
2691 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2692 # If there is no dlopen support or we're linking statically,
2693 # we need to preload.
2694 newdlprefiles="$newdlprefiles $deplib"
2695 compile_deplibs="$deplib $compile_deplibs"
2696 finalize_deplibs="$deplib $finalize_deplibs"
2697 else
2698 newdlfiles="$newdlfiles $deplib"
2701 continue
2703 %DEPLIBS%)
2704 alldeplibs=yes
2705 continue
2707 esac # case $deplib
2708 if test "$found" = yes || test -f "$lib"; then :
2709 else
2710 $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
2711 exit $EXIT_FAILURE
2714 # Check to see that this really is a libtool archive.
2715 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2716 else
2717 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2718 exit $EXIT_FAILURE
2721 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2722 test "X$ladir" = "X$lib" && ladir="."
2724 dlname=
2725 dlopen=
2726 dlpreopen=
2727 libdir=
2728 library_names=
2729 old_library=
2730 # If the library was installed with an old release of libtool,
2731 # it will not redefine variables installed, or shouldnotlink
2732 installed=yes
2733 shouldnotlink=no
2734 avoidtemprpath=
2737 # Read the .la file
2738 case $lib in
2739 */* | *\\*) . $lib ;;
2740 *) . ./$lib ;;
2741 esac
2743 if test "$linkmode,$pass" = "lib,link" ||
2744 test "$linkmode,$pass" = "prog,scan" ||
2745 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2746 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2747 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2750 if test "$pass" = conv; then
2751 # Only check for convenience libraries
2752 deplibs="$lib $deplibs"
2753 if test -z "$libdir"; then
2754 if test -z "$old_library"; then
2755 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2756 exit $EXIT_FAILURE
2758 # It is a libtool convenience library, so add in its objects.
2759 convenience="$convenience $ladir/$objdir/$old_library"
2760 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2761 tmp_libs=
2762 for deplib in $dependency_libs; do
2763 deplibs="$deplib $deplibs"
2764 if test "X$duplicate_deps" = "Xyes" ; then
2765 case "$tmp_libs " in
2766 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2767 esac
2769 tmp_libs="$tmp_libs $deplib"
2770 done
2771 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2772 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2773 exit $EXIT_FAILURE
2775 continue
2776 fi # $pass = conv
2779 # Get the name of the library we link against.
2780 linklib=
2781 for l in $old_library $library_names; do
2782 linklib="$l"
2783 done
2784 if test -z "$linklib"; then
2785 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2786 exit $EXIT_FAILURE
2789 # This library was specified with -dlopen.
2790 if test "$pass" = dlopen; then
2791 if test -z "$libdir"; then
2792 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2793 exit $EXIT_FAILURE
2795 if test -z "$dlname" ||
2796 test "$dlopen_support" != yes ||
2797 test "$build_libtool_libs" = no; then
2798 # If there is no dlname, no dlopen support or we're linking
2799 # statically, we need to preload. We also need to preload any
2800 # dependent libraries so libltdl's deplib preloader doesn't
2801 # bomb out in the load deplibs phase.
2802 dlprefiles="$dlprefiles $lib $dependency_libs"
2803 else
2804 newdlfiles="$newdlfiles $lib"
2806 continue
2807 fi # $pass = dlopen
2809 # We need an absolute path.
2810 case $ladir in
2811 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2813 abs_ladir=`cd "$ladir" && pwd`
2814 if test -z "$abs_ladir"; then
2815 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2816 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2817 abs_ladir="$ladir"
2820 esac
2821 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2823 # Find the relevant object directory and library name.
2824 if test "X$installed" = Xyes; then
2825 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2826 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2827 dir="$ladir"
2828 absdir="$abs_ladir"
2829 libdir="$abs_ladir"
2830 else
2831 dir="$libdir"
2832 absdir="$libdir"
2834 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2835 else
2836 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2837 dir="$ladir"
2838 absdir="$abs_ladir"
2839 # Remove this search path later
2840 notinst_path="$notinst_path $abs_ladir"
2841 else
2842 dir="$ladir/$objdir"
2843 absdir="$abs_ladir/$objdir"
2844 # Remove this search path later
2845 notinst_path="$notinst_path $abs_ladir"
2847 fi # $installed = yes
2848 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2850 # This library was specified with -dlpreopen.
2851 if test "$pass" = dlpreopen; then
2852 if test -z "$libdir"; then
2853 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2854 exit $EXIT_FAILURE
2856 # Prefer using a static library (so that no silly _DYNAMIC symbols
2857 # are required to link).
2858 if test -n "$old_library"; then
2859 newdlprefiles="$newdlprefiles $dir/$old_library"
2860 # Otherwise, use the dlname, so that lt_dlopen finds it.
2861 elif test -n "$dlname"; then
2862 newdlprefiles="$newdlprefiles $dir/$dlname"
2863 else
2864 newdlprefiles="$newdlprefiles $dir/$linklib"
2866 fi # $pass = dlpreopen
2868 if test -z "$libdir"; then
2869 # Link the convenience library
2870 if test "$linkmode" = lib; then
2871 deplibs="$dir/$old_library $deplibs"
2872 elif test "$linkmode,$pass" = "prog,link"; then
2873 compile_deplibs="$dir/$old_library $compile_deplibs"
2874 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2875 else
2876 deplibs="$lib $deplibs" # used for prog,scan pass
2878 continue
2882 if test "$linkmode" = prog && test "$pass" != link; then
2883 newlib_search_path="$newlib_search_path $ladir"
2884 deplibs="$lib $deplibs"
2886 linkalldeplibs=no
2887 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2888 test "$build_libtool_libs" = no; then
2889 linkalldeplibs=yes
2892 tmp_libs=
2893 for deplib in $dependency_libs; do
2894 case $deplib in
2895 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2896 esac
2897 # Need to link against all dependency_libs?
2898 if test "$linkalldeplibs" = yes; then
2899 deplibs="$deplib $deplibs"
2900 else
2901 # Need to hardcode shared library paths
2902 # or/and link against static libraries
2903 newdependency_libs="$deplib $newdependency_libs"
2905 if test "X$duplicate_deps" = "Xyes" ; then
2906 case "$tmp_libs " in
2907 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2908 esac
2910 tmp_libs="$tmp_libs $deplib"
2911 done # for deplib
2912 continue
2913 fi # $linkmode = prog...
2915 if test "$linkmode,$pass" = "prog,link"; then
2916 if test -n "$library_names" &&
2917 { { test "$prefer_static_libs" = no ||
2918 test "$prefer_static_libs,$installed" = "built,yes"; } ||
2919 test -z "$old_library"; }; then
2920 # We need to hardcode the library path
2921 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2922 # Make sure the rpath contains only unique directories.
2923 case "$temp_rpath " in
2924 *" $dir "*) ;;
2925 *" $absdir "*) ;;
2926 *) temp_rpath="$temp_rpath $absdir" ;;
2927 esac
2930 # Hardcode the library path.
2931 # Skip directories that are in the system default run-time
2932 # search path.
2933 case " $sys_lib_dlsearch_path " in
2934 *" $absdir "*) ;;
2936 case "$compile_rpath " in
2937 *" $absdir "*) ;;
2938 *) compile_rpath="$compile_rpath $absdir"
2939 esac
2941 esac
2942 case " $sys_lib_dlsearch_path " in
2943 *" $libdir "*) ;;
2945 case "$finalize_rpath " in
2946 *" $libdir "*) ;;
2947 *) finalize_rpath="$finalize_rpath $libdir"
2948 esac
2950 esac
2951 fi # $linkmode,$pass = prog,link...
2953 if test "$alldeplibs" = yes &&
2954 { test "$deplibs_check_method" = pass_all ||
2955 { test "$build_libtool_libs" = yes &&
2956 test -n "$library_names"; }; }; then
2957 # We only need to search for static libraries
2958 continue
2962 link_static=no # Whether the deplib will be linked statically
2963 use_static_libs=$prefer_static_libs
2964 if test "$use_static_libs" = built && test "$installed" = yes ; then
2965 use_static_libs=no
2967 if test -n "$library_names" &&
2968 { test "$use_static_libs" = no || test -z "$old_library"; }; then
2969 if test "$installed" = no; then
2970 notinst_deplibs="$notinst_deplibs $lib"
2971 need_relink=yes
2973 # This is a shared library
2975 # Warn about portability, can't link against -module's on
2976 # some systems (darwin)
2977 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2978 $echo
2979 if test "$linkmode" = prog; then
2980 $echo "*** Warning: Linking the executable $output against the loadable module"
2981 else
2982 $echo "*** Warning: Linking the shared library $output against the loadable module"
2984 $echo "*** $linklib is not portable!"
2986 if test "$linkmode" = lib &&
2987 test "$hardcode_into_libs" = yes; then
2988 # Hardcode the library path.
2989 # Skip directories that are in the system default run-time
2990 # search path.
2991 case " $sys_lib_dlsearch_path " in
2992 *" $absdir "*) ;;
2994 case "$compile_rpath " in
2995 *" $absdir "*) ;;
2996 *) compile_rpath="$compile_rpath $absdir"
2997 esac
2999 esac
3000 case " $sys_lib_dlsearch_path " in
3001 *" $libdir "*) ;;
3003 case "$finalize_rpath " in
3004 *" $libdir "*) ;;
3005 *) finalize_rpath="$finalize_rpath $libdir"
3006 esac
3008 esac
3011 if test -n "$old_archive_from_expsyms_cmds"; then
3012 # figure out the soname
3013 set dummy $library_names
3014 realname="$2"
3015 shift; shift
3016 libname=`eval \\$echo \"$libname_spec\"`
3017 # use dlname if we got it. it's perfectly good, no?
3018 if test -n "$dlname"; then
3019 soname="$dlname"
3020 elif test -n "$soname_spec"; then
3021 # bleh windows
3022 case $host in
3023 *cygwin* | mingw*)
3024 major=`expr $current - $age`
3025 versuffix="-$major"
3027 esac
3028 eval soname=\"$soname_spec\"
3029 else
3030 soname="$realname"
3033 # Make a new name for the extract_expsyms_cmds to use
3034 soroot="$soname"
3035 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
3036 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
3038 # If the library has no export list, then create one now
3039 if test -f "$output_objdir/$soname-def"; then :
3040 else
3041 $show "extracting exported symbol list from \`$soname'"
3042 save_ifs="$IFS"; IFS='~'
3043 cmds=$extract_expsyms_cmds
3044 for cmd in $cmds; do
3045 IFS="$save_ifs"
3046 eval cmd=\"$cmd\"
3047 $show "$cmd"
3048 $run eval "$cmd" || exit $?
3049 done
3050 IFS="$save_ifs"
3053 # Create $newlib
3054 if test -f "$output_objdir/$newlib"; then :; else
3055 $show "generating import library for \`$soname'"
3056 save_ifs="$IFS"; IFS='~'
3057 cmds=$old_archive_from_expsyms_cmds
3058 for cmd in $cmds; do
3059 IFS="$save_ifs"
3060 eval cmd=\"$cmd\"
3061 $show "$cmd"
3062 $run eval "$cmd" || exit $?
3063 done
3064 IFS="$save_ifs"
3066 # make sure the library variables are pointing to the new library
3067 dir=$output_objdir
3068 linklib=$newlib
3069 fi # test -n "$old_archive_from_expsyms_cmds"
3071 if test "$linkmode" = prog || test "$mode" != relink; then
3072 add_shlibpath=
3073 add_dir=
3074 add=
3075 lib_linked=yes
3076 case $hardcode_action in
3077 immediate | unsupported)
3078 if test "$hardcode_direct" = no; then
3079 add="$dir/$linklib"
3080 case $host in
3081 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
3082 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
3083 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
3084 *-*-unixware7*) add_dir="-L$dir" ;;
3085 *-*-darwin* )
3086 # if the lib is a module then we can not link against
3087 # it, someone is ignoring the new warnings I added
3088 if /usr/bin/file -L $add 2> /dev/null |
3089 $EGREP ": [^:]* bundle" >/dev/null ; then
3090 $echo "** Warning, lib $linklib is a module, not a shared library"
3091 if test -z "$old_library" ; then
3092 $echo
3093 $echo "** And there doesn't seem to be a static archive available"
3094 $echo "** The link will probably fail, sorry"
3095 else
3096 add="$dir/$old_library"
3099 esac
3100 elif test "$hardcode_minus_L" = no; then
3101 case $host in
3102 *-*-sunos*) add_shlibpath="$dir" ;;
3103 esac
3104 add_dir="-L$dir"
3105 add="-l$name"
3106 elif test "$hardcode_shlibpath_var" = no; then
3107 add_shlibpath="$dir"
3108 add="-l$name"
3109 else
3110 lib_linked=no
3113 relink)
3114 if test "$hardcode_direct" = yes; then
3115 add="$dir/$linklib"
3116 elif test "$hardcode_minus_L" = yes; then
3117 add_dir="-L$dir"
3118 # Try looking first in the location we're being installed to.
3119 if test -n "$inst_prefix_dir"; then
3120 case $libdir in
3121 [\\/]*)
3122 add_dir="$add_dir -L$inst_prefix_dir$libdir"
3124 esac
3126 add="-l$name"
3127 elif test "$hardcode_shlibpath_var" = yes; then
3128 add_shlibpath="$dir"
3129 add="-l$name"
3130 else
3131 lib_linked=no
3134 *) lib_linked=no ;;
3135 esac
3137 if test "$lib_linked" != yes; then
3138 $echo "$modename: configuration error: unsupported hardcode properties"
3139 exit $EXIT_FAILURE
3142 if test -n "$add_shlibpath"; then
3143 case :$compile_shlibpath: in
3144 *":$add_shlibpath:"*) ;;
3145 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
3146 esac
3148 if test "$linkmode" = prog; then
3149 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
3150 test -n "$add" && compile_deplibs="$add $compile_deplibs"
3151 else
3152 test -n "$add_dir" && deplibs="$add_dir $deplibs"
3153 test -n "$add" && deplibs="$add $deplibs"
3154 if test "$hardcode_direct" != yes && \
3155 test "$hardcode_minus_L" != yes && \
3156 test "$hardcode_shlibpath_var" = yes; then
3157 case :$finalize_shlibpath: in
3158 *":$libdir:"*) ;;
3159 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
3160 esac
3165 if test "$linkmode" = prog || test "$mode" = relink; then
3166 add_shlibpath=
3167 add_dir=
3168 add=
3169 # Finalize command for both is simple: just hardcode it.
3170 if test "$hardcode_direct" = yes; then
3171 add="$libdir/$linklib"
3172 elif test "$hardcode_minus_L" = yes; then
3173 add_dir="-L$libdir"
3174 add="-l$name"
3175 elif test "$hardcode_shlibpath_var" = yes; then
3176 case :$finalize_shlibpath: in
3177 *":$libdir:"*) ;;
3178 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
3179 esac
3180 add="-l$name"
3181 elif test "$hardcode_automatic" = yes; then
3182 if test -n "$inst_prefix_dir" &&
3183 test -f "$inst_prefix_dir$libdir/$linklib" ; then
3184 add="$inst_prefix_dir$libdir/$linklib"
3185 else
3186 add="$libdir/$linklib"
3188 else
3189 # We cannot seem to hardcode it, guess we'll fake it.
3190 add_dir="-L$libdir"
3191 # Try looking first in the location we're being installed to.
3192 if test -n "$inst_prefix_dir"; then
3193 case $libdir in
3194 [\\/]*)
3195 add_dir="$add_dir -L$inst_prefix_dir$libdir"
3197 esac
3199 add="-l$name"
3202 if test "$linkmode" = prog; then
3203 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
3204 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
3205 else
3206 test -n "$add_dir" && deplibs="$add_dir $deplibs"
3207 test -n "$add" && deplibs="$add $deplibs"
3210 elif test "$linkmode" = prog; then
3211 # Here we assume that one of hardcode_direct or hardcode_minus_L
3212 # is not unsupported. This is valid on all known static and
3213 # shared platforms.
3214 if test "$hardcode_direct" != unsupported; then
3215 test -n "$old_library" && linklib="$old_library"
3216 compile_deplibs="$dir/$linklib $compile_deplibs"
3217 finalize_deplibs="$dir/$linklib $finalize_deplibs"
3218 else
3219 compile_deplibs="-l$name -L$dir $compile_deplibs"
3220 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
3222 elif test "$build_libtool_libs" = yes; then
3223 # Not a shared library
3224 if test "$deplibs_check_method" != pass_all; then
3225 # We're trying link a shared library against a static one
3226 # but the system doesn't support it.
3228 # Just print a warning and add the library to dependency_libs so
3229 # that the program can be linked against the static library.
3230 $echo
3231 $echo "*** Warning: This system can not link to static lib archive $lib."
3232 $echo "*** I have the capability to make that library automatically link in when"
3233 $echo "*** you link to this library. But I can only do this if you have a"
3234 $echo "*** shared version of the library, which you do not appear to have."
3235 if test "$module" = yes; then
3236 $echo "*** But as you try to build a module library, libtool will still create "
3237 $echo "*** a static module, that should work as long as the dlopening application"
3238 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
3239 if test -z "$global_symbol_pipe"; then
3240 $echo
3241 $echo "*** However, this would only work if libtool was able to extract symbol"
3242 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3243 $echo "*** not find such a program. So, this module is probably useless."
3244 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3246 if test "$build_old_libs" = no; then
3247 build_libtool_libs=module
3248 build_old_libs=yes
3249 else
3250 build_libtool_libs=no
3253 else
3254 deplibs="$dir/$old_library $deplibs"
3255 link_static=yes
3257 fi # link shared/static library?
3259 if test "$linkmode" = lib; then
3260 if test -n "$dependency_libs" &&
3261 { test "$hardcode_into_libs" != yes ||
3262 test "$build_old_libs" = yes ||
3263 test "$link_static" = yes; }; then
3264 # Extract -R from dependency_libs
3265 temp_deplibs=
3266 for libdir in $dependency_libs; do
3267 case $libdir in
3268 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
3269 case " $xrpath " in
3270 *" $temp_xrpath "*) ;;
3271 *) xrpath="$xrpath $temp_xrpath";;
3272 esac;;
3273 *) temp_deplibs="$temp_deplibs $libdir";;
3274 esac
3275 done
3276 dependency_libs="$temp_deplibs"
3279 newlib_search_path="$newlib_search_path $absdir"
3280 # Link against this library
3281 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
3282 # ... and its dependency_libs
3283 tmp_libs=
3284 for deplib in $dependency_libs; do
3285 newdependency_libs="$deplib $newdependency_libs"
3286 if test "X$duplicate_deps" = "Xyes" ; then
3287 case "$tmp_libs " in
3288 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
3289 esac
3291 tmp_libs="$tmp_libs $deplib"
3292 done
3294 if test "$link_all_deplibs" != no; then
3295 # Add the search paths of all dependency libraries
3296 for deplib in $dependency_libs; do
3297 case $deplib in
3298 -L*) path="$deplib" ;;
3299 *.la)
3300 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
3301 test "X$dir" = "X$deplib" && dir="."
3302 # We need an absolute path.
3303 case $dir in
3304 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
3306 absdir=`cd "$dir" && pwd`
3307 if test -z "$absdir"; then
3308 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
3309 absdir="$dir"
3312 esac
3313 if grep "^installed=no" $deplib > /dev/null; then
3314 path="$absdir/$objdir"
3315 else
3316 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3317 if test -z "$libdir"; then
3318 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3319 exit $EXIT_FAILURE
3321 if test "$absdir" != "$libdir"; then
3322 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
3324 path="$absdir"
3326 depdepl=
3327 case $host in
3328 *-*-darwin*)
3329 # we do not want to link against static libs,
3330 # but need to link against shared
3331 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
3332 eval deplibdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3333 if test -n "$deplibrary_names" ; then
3334 for tmp in $deplibrary_names ; do
3335 depdepl=$tmp
3336 done
3337 if test -f "$deplibdir/$depdepl" ; then
3338 depdepl="$deplibdir/$depdepl"
3339 elif test -f "$path/$depdepl" ; then
3340 depdepl="$path/$depdepl"
3341 else
3342 # Can't find it, oh well...
3343 depdepl=
3345 # do not add paths which are already there
3346 case " $newlib_search_path " in
3347 *" $path "*) ;;
3348 *) newlib_search_path="$newlib_search_path $path";;
3349 esac
3351 path=""
3354 path="-L$path"
3356 esac
3358 -l*)
3359 case $host in
3360 *-*-darwin*)
3361 # Again, we only want to link against shared libraries
3362 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
3363 for tmp in $newlib_search_path ; do
3364 if test -f "$tmp/lib$tmp_libs.dylib" ; then
3365 eval depdepl="$tmp/lib$tmp_libs.dylib"
3366 break
3368 done
3369 path=""
3371 *) continue ;;
3372 esac
3374 *) continue ;;
3375 esac
3376 case " $deplibs " in
3377 *" $path "*) ;;
3378 *) deplibs="$path $deplibs" ;;
3379 esac
3380 case " $deplibs " in
3381 *" $depdepl "*) ;;
3382 *) deplibs="$depdepl $deplibs" ;;
3383 esac
3384 done
3385 fi # link_all_deplibs != no
3386 fi # linkmode = lib
3387 done # for deplib in $libs
3388 dependency_libs="$newdependency_libs"
3389 if test "$pass" = dlpreopen; then
3390 # Link the dlpreopened libraries before other libraries
3391 for deplib in $save_deplibs; do
3392 deplibs="$deplib $deplibs"
3393 done
3395 if test "$pass" != dlopen; then
3396 if test "$pass" != conv; then
3397 # Make sure lib_search_path contains only unique directories.
3398 lib_search_path=
3399 for dir in $newlib_search_path; do
3400 case "$lib_search_path " in
3401 *" $dir "*) ;;
3402 *) lib_search_path="$lib_search_path $dir" ;;
3403 esac
3404 done
3405 newlib_search_path=
3408 if test "$linkmode,$pass" != "prog,link"; then
3409 vars="deplibs"
3410 else
3411 vars="compile_deplibs finalize_deplibs"
3413 for var in $vars dependency_libs; do
3414 # Add libraries to $var in reverse order
3415 eval tmp_libs=\"\$$var\"
3416 new_libs=
3417 for deplib in $tmp_libs; do
3418 # FIXME: Pedantically, this is the right thing to do, so
3419 # that some nasty dependency loop isn't accidentally
3420 # broken:
3421 #new_libs="$deplib $new_libs"
3422 # Pragmatically, this seems to cause very few problems in
3423 # practice:
3424 case $deplib in
3425 -L*) new_libs="$deplib $new_libs" ;;
3426 -R*) ;;
3428 # And here is the reason: when a library appears more
3429 # than once as an explicit dependence of a library, or
3430 # is implicitly linked in more than once by the
3431 # compiler, it is considered special, and multiple
3432 # occurrences thereof are not removed. Compare this
3433 # with having the same library being listed as a
3434 # dependency of multiple other libraries: in this case,
3435 # we know (pedantically, we assume) the library does not
3436 # need to be listed more than once, so we keep only the
3437 # last copy. This is not always right, but it is rare
3438 # enough that we require users that really mean to play
3439 # such unportable linking tricks to link the library
3440 # using -Wl,-lname, so that libtool does not consider it
3441 # for duplicate removal.
3442 case " $specialdeplibs " in
3443 *" $deplib "*) new_libs="$deplib $new_libs" ;;
3445 case " $new_libs " in
3446 *" $deplib "*) ;;
3447 *) new_libs="$deplib $new_libs" ;;
3448 esac
3450 esac
3452 esac
3453 done
3454 tmp_libs=
3455 for deplib in $new_libs; do
3456 case $deplib in
3457 -L*)
3458 case " $tmp_libs " in
3459 *" $deplib "*) ;;
3460 *) tmp_libs="$tmp_libs $deplib" ;;
3461 esac
3463 *) tmp_libs="$tmp_libs $deplib" ;;
3464 esac
3465 done
3466 eval $var=\"$tmp_libs\"
3467 done # for var
3469 # Last step: remove runtime libs from dependency_libs
3470 # (they stay in deplibs)
3471 tmp_libs=
3472 for i in $dependency_libs ; do
3473 case " $predeps $postdeps $compiler_lib_search_path " in
3474 *" $i "*)
3475 i=""
3477 esac
3478 if test -n "$i" ; then
3479 tmp_libs="$tmp_libs $i"
3481 done
3482 dependency_libs=$tmp_libs
3483 done # for pass
3484 if test "$linkmode" = prog; then
3485 dlfiles="$newdlfiles"
3486 dlprefiles="$newdlprefiles"
3489 case $linkmode in
3490 oldlib)
3491 case " $deplibs" in
3492 *\ -l* | *\ -L*)
3493 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 ;;
3494 esac
3496 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3497 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3500 if test -n "$rpath"; then
3501 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3504 if test -n "$xrpath"; then
3505 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3508 if test -n "$vinfo"; then
3509 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3512 if test -n "$release"; then
3513 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3516 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3517 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3520 # Now set the variables for building old libraries.
3521 build_libtool_libs=no
3522 oldlibs="$output"
3523 objs="$objs$old_deplibs"
3526 lib)
3527 # Make sure we only generate libraries of the form `libNAME.la'.
3528 case $outputname in
3529 lib*)
3530 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3531 eval shared_ext=\"$shrext_cmds\"
3532 eval libname=\"$libname_spec\"
3535 if test "$module" = no; then
3536 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3537 $echo "$help" 1>&2
3538 exit $EXIT_FAILURE
3540 if test "$need_lib_prefix" != no; then
3541 # Add the "lib" prefix for modules if required
3542 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3543 eval shared_ext=\"$shrext_cmds\"
3544 eval libname=\"$libname_spec\"
3545 else
3546 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3549 esac
3551 if test -n "$objs"; then
3552 if test "$deplibs_check_method" != pass_all; then
3553 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3554 exit $EXIT_FAILURE
3555 else
3556 $echo
3557 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3558 $echo "*** objects $objs is not portable!"
3559 libobjs="$libobjs $objs"
3563 if test "$dlself" != no; then
3564 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3567 set dummy $rpath
3568 if test "$#" -gt 2; then
3569 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3571 install_libdir="$2"
3573 oldlibs=
3574 if test -z "$rpath"; then
3575 if test "$build_libtool_libs" = yes; then
3576 # Building a libtool convenience library.
3577 # Some compilers have problems with a `.al' extension so
3578 # convenience libraries should have the same extension an
3579 # archive normally would.
3580 oldlibs="$output_objdir/$libname.$libext $oldlibs"
3581 build_libtool_libs=convenience
3582 build_old_libs=yes
3585 if test -n "$vinfo"; then
3586 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3589 if test -n "$release"; then
3590 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3592 else
3594 # Parse the version information argument.
3595 save_ifs="$IFS"; IFS=':'
3596 set dummy $vinfo 0 0 0
3597 IFS="$save_ifs"
3599 if test -n "$8"; then
3600 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3601 $echo "$help" 1>&2
3602 exit $EXIT_FAILURE
3605 # convert absolute version numbers to libtool ages
3606 # this retains compatibility with .la files and attempts
3607 # to make the code below a bit more comprehensible
3609 case $vinfo_number in
3610 yes)
3611 number_major="$2"
3612 number_minor="$3"
3613 number_revision="$4"
3615 # There are really only two kinds -- those that
3616 # use the current revision as the major version
3617 # and those that subtract age and use age as
3618 # a minor version. But, then there is irix
3619 # which has an extra 1 added just for fun
3621 case $version_type in
3622 darwin|linux|osf|windows|none)
3623 current=`expr $number_major + $number_minor`
3624 age="$number_minor"
3625 revision="$number_revision"
3627 freebsd-aout|freebsd-elf|sunos)
3628 current="$number_major"
3629 revision="$number_minor"
3630 age="0"
3632 irix|nonstopux)
3633 current=`expr $number_major + $number_minor`
3634 age="$number_minor"
3635 revision="$number_minor"
3636 lt_irix_increment=no
3638 esac
3641 current="$2"
3642 revision="$3"
3643 age="$4"
3645 esac
3647 # Check that each of the things are valid numbers.
3648 case $current in
3649 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]) ;;
3651 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3652 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3653 exit $EXIT_FAILURE
3655 esac
3657 case $revision in
3658 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]) ;;
3660 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3661 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3662 exit $EXIT_FAILURE
3664 esac
3666 case $age in
3667 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]) ;;
3669 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3670 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3671 exit $EXIT_FAILURE
3673 esac
3675 if test "$age" -gt "$current"; then
3676 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3677 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3678 exit $EXIT_FAILURE
3681 # Calculate the version variables.
3682 major=
3683 versuffix=
3684 verstring=
3685 case $version_type in
3686 none) ;;
3688 darwin)
3689 # Like Linux, but with the current version available in
3690 # verstring for coding it into the library header
3691 major=.`expr $current - $age`
3692 versuffix="$major.$age.$revision"
3693 # Darwin ld doesn't like 0 for these options...
3694 minor_current=`expr $current + 1`
3695 xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3696 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
3699 freebsd-aout)
3700 major=".$current"
3701 versuffix=".$current.$revision";
3704 freebsd-elf)
3705 major=".$current"
3706 versuffix=".$current";
3709 irix | nonstopux)
3710 if test "X$lt_irix_increment" = "Xno"; then
3711 major=`expr $current - $age`
3712 else
3713 major=`expr $current - $age + 1`
3715 case $version_type in
3716 nonstopux) verstring_prefix=nonstopux ;;
3717 *) verstring_prefix=sgi ;;
3718 esac
3719 verstring="$verstring_prefix$major.$revision"
3721 # Add in all the interfaces that we are compatible with.
3722 loop=$revision
3723 while test "$loop" -ne 0; do
3724 iface=`expr $revision - $loop`
3725 loop=`expr $loop - 1`
3726 verstring="$verstring_prefix$major.$iface:$verstring"
3727 done
3729 # Before this point, $major must not contain `.'.
3730 major=.$major
3731 versuffix="$major.$revision"
3734 linux)
3735 major=.`expr $current - $age`
3736 versuffix="$major.$age.$revision"
3739 osf)
3740 major=.`expr $current - $age`
3741 versuffix=".$current.$age.$revision"
3742 verstring="$current.$age.$revision"
3744 # Add in all the interfaces that we are compatible with.
3745 loop=$age
3746 while test "$loop" -ne 0; do
3747 iface=`expr $current - $loop`
3748 loop=`expr $loop - 1`
3749 verstring="$verstring:${iface}.0"
3750 done
3752 # Make executables depend on our current version.
3753 verstring="$verstring:${current}.0"
3756 sunos)
3757 major=".$current"
3758 versuffix=".$current.$revision"
3761 windows)
3762 # Use '-' rather than '.', since we only want one
3763 # extension on DOS 8.3 filesystems.
3764 major=`expr $current - $age`
3765 versuffix="-$major"
3769 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3770 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3771 exit $EXIT_FAILURE
3773 esac
3775 # Clear the version info if we defaulted, and they specified a release.
3776 if test -z "$vinfo" && test -n "$release"; then
3777 major=
3778 case $version_type in
3779 darwin)
3780 # we can't check for "0.0" in archive_cmds due to quoting
3781 # problems, so we reset it completely
3782 verstring=
3785 verstring="0.0"
3787 esac
3788 if test "$need_version" = no; then
3789 versuffix=
3790 else
3791 versuffix=".0.0"
3795 # Remove version info from name if versioning should be avoided
3796 if test "$avoid_version" = yes && test "$need_version" = no; then
3797 major=
3798 versuffix=
3799 verstring=""
3802 # Check to see if the archive will have undefined symbols.
3803 if test "$allow_undefined" = yes; then
3804 if test "$allow_undefined_flag" = unsupported; then
3805 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3806 build_libtool_libs=no
3807 build_old_libs=yes
3809 else
3810 # Don't allow undefined symbols.
3811 allow_undefined_flag="$no_undefined_flag"
3815 if test "$mode" != relink; then
3816 # Remove our outputs, but don't remove object files since they
3817 # may have been created when compiling PIC objects.
3818 removelist=
3819 tempremovelist=`$echo "$output_objdir/*"`
3820 for p in $tempremovelist; do
3821 case $p in
3822 *.$objext)
3824 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3825 if test "X$precious_files_regex" != "X"; then
3826 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3827 then
3828 continue
3831 removelist="$removelist $p"
3833 *) ;;
3834 esac
3835 done
3836 if test -n "$removelist"; then
3837 $show "${rm}r $removelist"
3838 $run ${rm}r $removelist
3842 # Now set the variables for building old libraries.
3843 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3844 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3846 # Transform .lo files to .o files.
3847 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3850 # Eliminate all temporary directories.
3851 #for path in $notinst_path; do
3852 # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
3853 # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
3854 # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
3855 #done
3857 if test -n "$xrpath"; then
3858 # If the user specified any rpath flags, then add them.
3859 temp_xrpath=
3860 for libdir in $xrpath; do
3861 temp_xrpath="$temp_xrpath -R$libdir"
3862 case "$finalize_rpath " in
3863 *" $libdir "*) ;;
3864 *) finalize_rpath="$finalize_rpath $libdir" ;;
3865 esac
3866 done
3867 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3868 dependency_libs="$temp_xrpath $dependency_libs"
3872 # Make sure dlfiles contains only unique files that won't be dlpreopened
3873 old_dlfiles="$dlfiles"
3874 dlfiles=
3875 for lib in $old_dlfiles; do
3876 case " $dlprefiles $dlfiles " in
3877 *" $lib "*) ;;
3878 *) dlfiles="$dlfiles $lib" ;;
3879 esac
3880 done
3882 # Make sure dlprefiles contains only unique files
3883 old_dlprefiles="$dlprefiles"
3884 dlprefiles=
3885 for lib in $old_dlprefiles; do
3886 case "$dlprefiles " in
3887 *" $lib "*) ;;
3888 *) dlprefiles="$dlprefiles $lib" ;;
3889 esac
3890 done
3892 if test "$build_libtool_libs" = yes; then
3893 if test -n "$rpath"; then
3894 case $host in
3895 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3896 # these systems don't actually have a c library (as such)!
3898 *-*-rhapsody* | *-*-darwin1.[012])
3899 # Rhapsody C library is in the System framework
3900 deplibs="$deplibs -framework System"
3902 *-*-netbsd*)
3903 # Don't link with libc until the a.out ld.so is fixed.
3905 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3906 # Do not include libc due to us having libc/libc_r.
3908 *-*-sco3.2v5* | *-*-sco5v6*)
3909 # Causes problems with __ctype
3911 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
3912 # Compiler inserts libc in the correct place for threads to work
3915 # Add libc to deplibs on all other systems if necessary.
3916 if test "$build_libtool_need_lc" = "yes"; then
3917 deplibs="$deplibs -lc"
3920 esac
3923 # Transform deplibs into only deplibs that can be linked in shared.
3924 name_save=$name
3925 libname_save=$libname
3926 release_save=$release
3927 versuffix_save=$versuffix
3928 major_save=$major
3929 # I'm not sure if I'm treating the release correctly. I think
3930 # release should show up in the -l (ie -lgmp5) so we don't want to
3931 # add it in twice. Is that correct?
3932 release=""
3933 versuffix=""
3934 major=""
3935 newdeplibs=
3936 droppeddeps=no
3937 case $deplibs_check_method in
3938 pass_all)
3939 # Don't check for shared/static. Everything works.
3940 # This might be a little naive. We might want to check
3941 # whether the library exists or not. But this is on
3942 # osf3 & osf4 and I'm not really sure... Just
3943 # implementing what was already the behavior.
3944 newdeplibs=$deplibs
3946 test_compile)
3947 # This code stresses the "libraries are programs" paradigm to its
3948 # limits. Maybe even breaks it. We compile a program, linking it
3949 # against the deplibs as a proxy for the library. Then we can check
3950 # whether they linked in statically or dynamically with ldd.
3951 $rm conftest.c
3952 cat > conftest.c <<EOF
3953 int main() { return 0; }
3955 $rm conftest
3956 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
3957 ldd_output=`ldd conftest`
3958 for i in $deplibs; do
3959 name=`expr $i : '-l\(.*\)'`
3960 # If $name is empty we are operating on a -L argument.
3961 if test "$name" != "" && test "$name" != "0"; then
3962 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3963 case " $predeps $postdeps " in
3964 *" $i "*)
3965 newdeplibs="$newdeplibs $i"
3966 i=""
3968 esac
3970 if test -n "$i" ; then
3971 libname=`eval \\$echo \"$libname_spec\"`
3972 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3973 set dummy $deplib_matches
3974 deplib_match=$2
3975 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3976 newdeplibs="$newdeplibs $i"
3977 else
3978 droppeddeps=yes
3979 $echo
3980 $echo "*** Warning: dynamic linker does not accept needed library $i."
3981 $echo "*** I have the capability to make that library automatically link in when"
3982 $echo "*** you link to this library. But I can only do this if you have a"
3983 $echo "*** shared version of the library, which I believe you do not have"
3984 $echo "*** because a test_compile did reveal that the linker did not use it for"
3985 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3988 else
3989 newdeplibs="$newdeplibs $i"
3991 done
3992 else
3993 # Error occurred in the first compile. Let's try to salvage
3994 # the situation: Compile a separate program for each library.
3995 for i in $deplibs; do
3996 name=`expr $i : '-l\(.*\)'`
3997 # If $name is empty we are operating on a -L argument.
3998 if test "$name" != "" && test "$name" != "0"; then
3999 $rm conftest
4000 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
4001 ldd_output=`ldd conftest`
4002 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4003 case " $predeps $postdeps " in
4004 *" $i "*)
4005 newdeplibs="$newdeplibs $i"
4006 i=""
4008 esac
4010 if test -n "$i" ; then
4011 libname=`eval \\$echo \"$libname_spec\"`
4012 deplib_matches=`eval \\$echo \"$library_names_spec\"`
4013 set dummy $deplib_matches
4014 deplib_match=$2
4015 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
4016 newdeplibs="$newdeplibs $i"
4017 else
4018 droppeddeps=yes
4019 $echo
4020 $echo "*** Warning: dynamic linker does not accept needed library $i."
4021 $echo "*** I have the capability to make that library automatically link in when"
4022 $echo "*** you link to this library. But I can only do this if you have a"
4023 $echo "*** shared version of the library, which you do not appear to have"
4024 $echo "*** because a test_compile did reveal that the linker did not use this one"
4025 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
4028 else
4029 droppeddeps=yes
4030 $echo
4031 $echo "*** Warning! Library $i is needed by this library but I was not able to"
4032 $echo "*** make it link in! You will probably need to install it or some"
4033 $echo "*** library that it depends on before this library will be fully"
4034 $echo "*** functional. Installing it before continuing would be even better."
4036 else
4037 newdeplibs="$newdeplibs $i"
4039 done
4042 file_magic*)
4043 set dummy $deplibs_check_method
4044 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
4045 for a_deplib in $deplibs; do
4046 name=`expr $a_deplib : '-l\(.*\)'`
4047 # If $name is empty we are operating on a -L argument.
4048 if test "$name" != "" && test "$name" != "0"; then
4049 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4050 case " $predeps $postdeps " in
4051 *" $a_deplib "*)
4052 newdeplibs="$newdeplibs $a_deplib"
4053 a_deplib=""
4055 esac
4057 if test -n "$a_deplib" ; then
4058 libname=`eval \\$echo \"$libname_spec\"`
4059 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
4060 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
4061 for potent_lib in $potential_libs; do
4062 # Follow soft links.
4063 if ls -lLd "$potent_lib" 2>/dev/null \
4064 | grep " -> " >/dev/null; then
4065 continue
4067 # The statement above tries to avoid entering an
4068 # endless loop below, in case of cyclic links.
4069 # We might still enter an endless loop, since a link
4070 # loop can be closed while we follow links,
4071 # but so what?
4072 potlib="$potent_lib"
4073 while test -h "$potlib" 2>/dev/null; do
4074 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
4075 case $potliblink in
4076 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
4077 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
4078 esac
4079 done
4080 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
4081 | ${SED} 10q \
4082 | $EGREP "$file_magic_regex" > /dev/null; then
4083 newdeplibs="$newdeplibs $a_deplib"
4084 a_deplib=""
4085 break 2
4087 done
4088 done
4090 if test -n "$a_deplib" ; then
4091 droppeddeps=yes
4092 $echo
4093 $echo "*** Warning: linker path does not have real file for library $a_deplib."
4094 $echo "*** I have the capability to make that library automatically link in when"
4095 $echo "*** you link to this library. But I can only do this if you have a"
4096 $echo "*** shared version of the library, which you do not appear to have"
4097 $echo "*** because I did check the linker path looking for a file starting"
4098 if test -z "$potlib" ; then
4099 $echo "*** with $libname but no candidates were found. (...for file magic test)"
4100 else
4101 $echo "*** with $libname and none of the candidates passed a file format test"
4102 $echo "*** using a file magic. Last file checked: $potlib"
4105 else
4106 # Add a -L argument.
4107 newdeplibs="$newdeplibs $a_deplib"
4109 done # Gone through all deplibs.
4111 match_pattern*)
4112 set dummy $deplibs_check_method
4113 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
4114 for a_deplib in $deplibs; do
4115 name=`expr $a_deplib : '-l\(.*\)'`
4116 # If $name is empty we are operating on a -L argument.
4117 if test -n "$name" && test "$name" != "0"; then
4118 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4119 case " $predeps $postdeps " in
4120 *" $a_deplib "*)
4121 newdeplibs="$newdeplibs $a_deplib"
4122 a_deplib=""
4124 esac
4126 if test -n "$a_deplib" ; then
4127 libname=`eval \\$echo \"$libname_spec\"`
4128 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
4129 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
4130 for potent_lib in $potential_libs; do
4131 potlib="$potent_lib" # see symlink-check above in file_magic test
4132 if eval $echo \"$potent_lib\" 2>/dev/null \
4133 | ${SED} 10q \
4134 | $EGREP "$match_pattern_regex" > /dev/null; then
4135 newdeplibs="$newdeplibs $a_deplib"
4136 a_deplib=""
4137 break 2
4139 done
4140 done
4142 if test -n "$a_deplib" ; then
4143 droppeddeps=yes
4144 $echo
4145 $echo "*** Warning: linker path does not have real file for library $a_deplib."
4146 $echo "*** I have the capability to make that library automatically link in when"
4147 $echo "*** you link to this library. But I can only do this if you have a"
4148 $echo "*** shared version of the library, which you do not appear to have"
4149 $echo "*** because I did check the linker path looking for a file starting"
4150 if test -z "$potlib" ; then
4151 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
4152 else
4153 $echo "*** with $libname and none of the candidates passed a file format test"
4154 $echo "*** using a regex pattern. Last file checked: $potlib"
4157 else
4158 # Add a -L argument.
4159 newdeplibs="$newdeplibs $a_deplib"
4161 done # Gone through all deplibs.
4163 none | unknown | *)
4164 newdeplibs=""
4165 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
4166 -e 's/ -[LR][^ ]*//g'`
4167 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4168 for i in $predeps $postdeps ; do
4169 # can't use Xsed below, because $i might contain '/'
4170 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
4171 done
4173 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
4174 | grep . >/dev/null; then
4175 $echo
4176 if test "X$deplibs_check_method" = "Xnone"; then
4177 $echo "*** Warning: inter-library dependencies are not supported in this platform."
4178 else
4179 $echo "*** Warning: inter-library dependencies are not known to be supported."
4181 $echo "*** All declared inter-library dependencies are being dropped."
4182 droppeddeps=yes
4185 esac
4186 versuffix=$versuffix_save
4187 major=$major_save
4188 release=$release_save
4189 libname=$libname_save
4190 name=$name_save
4192 case $host in
4193 *-*-rhapsody* | *-*-darwin1.[012])
4194 # On Rhapsody replace the C library is the System framework
4195 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
4197 esac
4199 if test "$droppeddeps" = yes; then
4200 if test "$module" = yes; then
4201 $echo
4202 $echo "*** Warning: libtool could not satisfy all declared inter-library"
4203 $echo "*** dependencies of module $libname. Therefore, libtool will create"
4204 $echo "*** a static module, that should work as long as the dlopening"
4205 $echo "*** application is linked with the -dlopen flag."
4206 if test -z "$global_symbol_pipe"; then
4207 $echo
4208 $echo "*** However, this would only work if libtool was able to extract symbol"
4209 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
4210 $echo "*** not find such a program. So, this module is probably useless."
4211 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
4213 if test "$build_old_libs" = no; then
4214 oldlibs="$output_objdir/$libname.$libext"
4215 build_libtool_libs=module
4216 build_old_libs=yes
4217 else
4218 build_libtool_libs=no
4220 else
4221 $echo "*** The inter-library dependencies that have been dropped here will be"
4222 $echo "*** automatically added whenever a program is linked with this library"
4223 $echo "*** or is declared to -dlopen it."
4225 if test "$allow_undefined" = no; then
4226 $echo
4227 $echo "*** Since this library must not contain undefined symbols,"
4228 $echo "*** because either the platform does not support them or"
4229 $echo "*** it was explicitly requested with -no-undefined,"
4230 $echo "*** libtool will only create a static version of it."
4231 if test "$build_old_libs" = no; then
4232 oldlibs="$output_objdir/$libname.$libext"
4233 build_libtool_libs=module
4234 build_old_libs=yes
4235 else
4236 build_libtool_libs=no
4241 # Done checking deplibs!
4242 deplibs=$newdeplibs
4246 # move library search paths that coincide with paths to not yet
4247 # installed libraries to the beginning of the library search list
4248 new_libs=
4249 for path in $notinst_path; do
4250 case " $new_libs " in
4251 *" -L$path/$objdir "*) ;;
4253 case " $deplibs " in
4254 *" -L$path/$objdir "*)
4255 new_libs="$new_libs -L$path/$objdir" ;;
4256 esac
4258 esac
4259 done
4260 for deplib in $deplibs; do
4261 case $deplib in
4262 -L*)
4263 case " $new_libs " in
4264 *" $deplib "*) ;;
4265 *) new_libs="$new_libs $deplib" ;;
4266 esac
4268 *) new_libs="$new_libs $deplib" ;;
4269 esac
4270 done
4271 deplibs="$new_libs"
4274 # All the library-specific variables (install_libdir is set above).
4275 library_names=
4276 old_library=
4277 dlname=
4279 # Test again, we may have decided not to build it any more
4280 if test "$build_libtool_libs" = yes; then
4281 if test "$hardcode_into_libs" = yes; then
4282 # Hardcode the library paths
4283 hardcode_libdirs=
4284 dep_rpath=
4285 rpath="$finalize_rpath"
4286 test "$mode" != relink && rpath="$compile_rpath$rpath"
4287 for libdir in $rpath; do
4288 if test -n "$hardcode_libdir_flag_spec"; then
4289 if test -n "$hardcode_libdir_separator"; then
4290 if test -z "$hardcode_libdirs"; then
4291 hardcode_libdirs="$libdir"
4292 else
4293 # Just accumulate the unique libdirs.
4294 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4295 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4298 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4300 esac
4302 else
4303 eval flag=\"$hardcode_libdir_flag_spec\"
4304 dep_rpath="$dep_rpath $flag"
4306 elif test -n "$runpath_var"; then
4307 case "$perm_rpath " in
4308 *" $libdir "*) ;;
4309 *) perm_rpath="$perm_rpath $libdir" ;;
4310 esac
4312 done
4313 # Substitute the hardcoded libdirs into the rpath.
4314 if test -n "$hardcode_libdir_separator" &&
4315 test -n "$hardcode_libdirs"; then
4316 libdir="$hardcode_libdirs"
4317 if test -n "$hardcode_libdir_flag_spec_ld"; then
4318 case $archive_cmds in
4319 *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;;
4320 *) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;;
4321 esac
4322 else
4323 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
4326 if test -n "$runpath_var" && test -n "$perm_rpath"; then
4327 # We should set the runpath_var.
4328 rpath=
4329 for dir in $perm_rpath; do
4330 rpath="$rpath$dir:"
4331 done
4332 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
4334 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
4337 shlibpath="$finalize_shlibpath"
4338 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
4339 if test -n "$shlibpath"; then
4340 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
4343 # Get the real and link names of the library.
4344 eval shared_ext=\"$shrext_cmds\"
4345 eval library_names=\"$library_names_spec\"
4346 set dummy $library_names
4347 realname="$2"
4348 shift; shift
4350 if test -n "$soname_spec"; then
4351 eval soname=\"$soname_spec\"
4352 else
4353 soname="$realname"
4355 if test -z "$dlname"; then
4356 dlname=$soname
4359 lib="$output_objdir/$realname"
4360 linknames=
4361 for link
4363 linknames="$linknames $link"
4364 done
4366 # Use standard objects if they are pic
4367 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4369 # Prepare the list of exported symbols
4370 if test -z "$export_symbols"; then
4371 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
4372 $show "generating symbol list for \`$libname.la'"
4373 export_symbols="$output_objdir/$libname.exp"
4374 $run $rm $export_symbols
4375 cmds=$export_symbols_cmds
4376 save_ifs="$IFS"; IFS='~'
4377 for cmd in $cmds; do
4378 IFS="$save_ifs"
4379 eval cmd=\"$cmd\"
4380 if len=`expr "X$cmd" : ".*"` &&
4381 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4382 $show "$cmd"
4383 $run eval "$cmd" || exit $?
4384 skipped_export=false
4385 else
4386 # The command line is too long to execute in one step.
4387 $show "using reloadable object file for export list..."
4388 skipped_export=:
4389 # Break out early, otherwise skipped_export may be
4390 # set to false by a later but shorter cmd.
4391 break
4393 done
4394 IFS="$save_ifs"
4395 if test -n "$export_symbols_regex"; then
4396 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
4397 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
4398 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
4399 $run eval '$mv "${export_symbols}T" "$export_symbols"'
4404 if test -n "$export_symbols" && test -n "$include_expsyms"; then
4405 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
4408 tmp_deplibs=
4409 for test_deplib in $deplibs; do
4410 case " $convenience " in
4411 *" $test_deplib "*) ;;
4413 tmp_deplibs="$tmp_deplibs $test_deplib"
4415 esac
4416 done
4417 deplibs="$tmp_deplibs"
4419 if test -n "$convenience"; then
4420 if test -n "$whole_archive_flag_spec"; then
4421 save_libobjs=$libobjs
4422 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4423 else
4424 gentop="$output_objdir/${outputname}x"
4425 generated="$generated $gentop"
4427 func_extract_archives $gentop $convenience
4428 libobjs="$libobjs $func_extract_archives_result"
4432 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
4433 eval flag=\"$thread_safe_flag_spec\"
4434 linker_flags="$linker_flags $flag"
4437 # Make a backup of the uninstalled library when relinking
4438 if test "$mode" = relink; then
4439 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
4442 # Do each of the archive commands.
4443 if test "$module" = yes && test -n "$module_cmds" ; then
4444 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4445 eval test_cmds=\"$module_expsym_cmds\"
4446 cmds=$module_expsym_cmds
4447 else
4448 eval test_cmds=\"$module_cmds\"
4449 cmds=$module_cmds
4451 else
4452 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4453 eval test_cmds=\"$archive_expsym_cmds\"
4454 cmds=$archive_expsym_cmds
4455 else
4456 eval test_cmds=\"$archive_cmds\"
4457 cmds=$archive_cmds
4461 if test "X$skipped_export" != "X:" &&
4462 len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4463 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4465 else
4466 # The command line is too long to link in one step, link piecewise.
4467 $echo "creating reloadable object files..."
4469 # Save the value of $output and $libobjs because we want to
4470 # use them later. If we have whole_archive_flag_spec, we
4471 # want to use save_libobjs as it was before
4472 # whole_archive_flag_spec was expanded, because we can't
4473 # assume the linker understands whole_archive_flag_spec.
4474 # This may have to be revisited, in case too many
4475 # convenience libraries get linked in and end up exceeding
4476 # the spec.
4477 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
4478 save_libobjs=$libobjs
4480 save_output=$output
4481 output_la=`$echo "X$output" | $Xsed -e "$basename"`
4483 # Clear the reloadable object creation command queue and
4484 # initialize k to one.
4485 test_cmds=
4486 concat_cmds=
4487 objlist=
4488 delfiles=
4489 last_robj=
4491 output=$output_objdir/$output_la-${k}.$objext
4492 # Loop over the list of objects to be linked.
4493 for obj in $save_libobjs
4495 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
4496 if test "X$objlist" = X ||
4497 { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4498 test "$len" -le "$max_cmd_len"; }; then
4499 objlist="$objlist $obj"
4500 else
4501 # The command $test_cmds is almost too long, add a
4502 # command to the queue.
4503 if test "$k" -eq 1 ; then
4504 # The first file doesn't have a previous command to add.
4505 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
4506 else
4507 # All subsequent reloadable object files will link in
4508 # the last one created.
4509 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
4511 last_robj=$output_objdir/$output_la-${k}.$objext
4512 k=`expr $k + 1`
4513 output=$output_objdir/$output_la-${k}.$objext
4514 objlist=$obj
4515 len=1
4517 done
4518 # Handle the remaining objects by creating one last
4519 # reloadable object file. All subsequent reloadable object
4520 # files will link in the last one created.
4521 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4522 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
4524 if ${skipped_export-false}; then
4525 $show "generating symbol list for \`$libname.la'"
4526 export_symbols="$output_objdir/$libname.exp"
4527 $run $rm $export_symbols
4528 libobjs=$output
4529 # Append the command to create the export file.
4530 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
4533 # Set up a command to remove the reloadable object files
4534 # after they are used.
4536 while test "$i" -lt "$k"
4538 i=`expr $i + 1`
4539 delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
4540 done
4542 $echo "creating a temporary reloadable object file: $output"
4544 # Loop through the commands generated above and execute them.
4545 save_ifs="$IFS"; IFS='~'
4546 for cmd in $concat_cmds; do
4547 IFS="$save_ifs"
4548 $show "$cmd"
4549 $run eval "$cmd" || exit $?
4550 done
4551 IFS="$save_ifs"
4553 libobjs=$output
4554 # Restore the value of output.
4555 output=$save_output
4557 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4558 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4560 # Expand the library linking commands again to reset the
4561 # value of $libobjs for piecewise linking.
4563 # Do each of the archive commands.
4564 if test "$module" = yes && test -n "$module_cmds" ; then
4565 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4566 cmds=$module_expsym_cmds
4567 else
4568 cmds=$module_cmds
4570 else
4571 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4572 cmds=$archive_expsym_cmds
4573 else
4574 cmds=$archive_cmds
4578 # Append the command to remove the reloadable object files
4579 # to the just-reset $cmds.
4580 eval cmds=\"\$cmds~\$rm $delfiles\"
4582 save_ifs="$IFS"; IFS='~'
4583 for cmd in $cmds; do
4584 IFS="$save_ifs"
4585 eval cmd=\"$cmd\"
4586 $show "$cmd"
4587 $run eval "$cmd" || {
4588 lt_exit=$?
4590 # Restore the uninstalled library and exit
4591 if test "$mode" = relink; then
4592 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
4595 exit $lt_exit
4597 done
4598 IFS="$save_ifs"
4600 # Restore the uninstalled library and exit
4601 if test "$mode" = relink; then
4602 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4604 if test -n "$convenience"; then
4605 if test -z "$whole_archive_flag_spec"; then
4606 $show "${rm}r $gentop"
4607 $run ${rm}r "$gentop"
4611 exit $EXIT_SUCCESS
4614 # Create links to the real library.
4615 for linkname in $linknames; do
4616 if test "$realname" != "$linkname"; then
4617 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4618 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4620 done
4622 # If -module or -export-dynamic was specified, set the dlname.
4623 if test "$module" = yes || test "$export_dynamic" = yes; then
4624 # On all known operating systems, these are identical.
4625 dlname="$soname"
4630 obj)
4631 case " $deplibs" in
4632 *\ -l* | *\ -L*)
4633 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 ;;
4634 esac
4636 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4637 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4640 if test -n "$rpath"; then
4641 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4644 if test -n "$xrpath"; then
4645 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4648 if test -n "$vinfo"; then
4649 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4652 if test -n "$release"; then
4653 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4656 case $output in
4657 *.lo)
4658 if test -n "$objs$old_deplibs"; then
4659 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4660 exit $EXIT_FAILURE
4662 libobj="$output"
4663 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4666 libobj=
4667 obj="$output"
4669 esac
4671 # Delete the old objects.
4672 $run $rm $obj $libobj
4674 # Objects from convenience libraries. This assumes
4675 # single-version convenience libraries. Whenever we create
4676 # different ones for PIC/non-PIC, this we'll have to duplicate
4677 # the extraction.
4678 reload_conv_objs=
4679 gentop=
4680 # reload_cmds runs $LD directly, so let us get rid of
4681 # -Wl from whole_archive_flag_spec and hope we can get by with
4682 # turning comma into space..
4685 if test -n "$convenience"; then
4686 if test -n "$whole_archive_flag_spec"; then
4687 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
4688 reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
4689 else
4690 gentop="$output_objdir/${obj}x"
4691 generated="$generated $gentop"
4693 func_extract_archives $gentop $convenience
4694 reload_conv_objs="$reload_objs $func_extract_archives_result"
4698 # Create the old-style object.
4699 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
4701 output="$obj"
4702 cmds=$reload_cmds
4703 save_ifs="$IFS"; IFS='~'
4704 for cmd in $cmds; do
4705 IFS="$save_ifs"
4706 eval cmd=\"$cmd\"
4707 $show "$cmd"
4708 $run eval "$cmd" || exit $?
4709 done
4710 IFS="$save_ifs"
4712 # Exit if we aren't doing a library object file.
4713 if test -z "$libobj"; then
4714 if test -n "$gentop"; then
4715 $show "${rm}r $gentop"
4716 $run ${rm}r $gentop
4719 exit $EXIT_SUCCESS
4722 if test "$build_libtool_libs" != yes; then
4723 if test -n "$gentop"; then
4724 $show "${rm}r $gentop"
4725 $run ${rm}r $gentop
4728 # Create an invalid libtool object if no PIC, so that we don't
4729 # accidentally link it into a program.
4730 # $show "echo timestamp > $libobj"
4731 # $run eval "echo timestamp > $libobj" || exit $?
4732 exit $EXIT_SUCCESS
4735 if test -n "$pic_flag" || test "$pic_mode" != default; then
4736 # Only do commands if we really have different PIC objects.
4737 reload_objs="$libobjs $reload_conv_objs"
4738 output="$libobj"
4739 cmds=$reload_cmds
4740 save_ifs="$IFS"; IFS='~'
4741 for cmd in $cmds; do
4742 IFS="$save_ifs"
4743 eval cmd=\"$cmd\"
4744 $show "$cmd"
4745 $run eval "$cmd" || exit $?
4746 done
4747 IFS="$save_ifs"
4750 if test -n "$gentop"; then
4751 $show "${rm}r $gentop"
4752 $run ${rm}r $gentop
4755 exit $EXIT_SUCCESS
4758 prog)
4759 case $host in
4760 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4761 esac
4762 if test -n "$vinfo"; then
4763 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4766 if test -n "$release"; then
4767 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4770 if test "$preload" = yes; then
4771 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4772 test "$dlopen_self_static" = unknown; then
4773 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4777 case $host in
4778 *-*-rhapsody* | *-*-darwin1.[012])
4779 # On Rhapsody replace the C library is the System framework
4780 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4781 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4783 esac
4785 case $host in
4786 *darwin*)
4787 # Don't allow lazy linking, it breaks C++ global constructors
4788 if test "$tagname" = CXX ; then
4789 compile_command="$compile_command ${wl}-bind_at_load"
4790 finalize_command="$finalize_command ${wl}-bind_at_load"
4793 esac
4796 # move library search paths that coincide with paths to not yet
4797 # installed libraries to the beginning of the library search list
4798 new_libs=
4799 for path in $notinst_path; do
4800 case " $new_libs " in
4801 *" -L$path/$objdir "*) ;;
4803 case " $compile_deplibs " in
4804 *" -L$path/$objdir "*)
4805 new_libs="$new_libs -L$path/$objdir" ;;
4806 esac
4808 esac
4809 done
4810 for deplib in $compile_deplibs; do
4811 case $deplib in
4812 -L*)
4813 case " $new_libs " in
4814 *" $deplib "*) ;;
4815 *) new_libs="$new_libs $deplib" ;;
4816 esac
4818 *) new_libs="$new_libs $deplib" ;;
4819 esac
4820 done
4821 compile_deplibs="$new_libs"
4824 compile_command="$compile_command $compile_deplibs"
4825 finalize_command="$finalize_command $finalize_deplibs"
4827 if test -n "$rpath$xrpath"; then
4828 # If the user specified any rpath flags, then add them.
4829 for libdir in $rpath $xrpath; do
4830 # This is the magic to use -rpath.
4831 case "$finalize_rpath " in
4832 *" $libdir "*) ;;
4833 *) finalize_rpath="$finalize_rpath $libdir" ;;
4834 esac
4835 done
4838 # Now hardcode the library paths
4839 rpath=
4840 hardcode_libdirs=
4841 for libdir in $compile_rpath $finalize_rpath; do
4842 if test -n "$hardcode_libdir_flag_spec"; then
4843 if test -n "$hardcode_libdir_separator"; then
4844 if test -z "$hardcode_libdirs"; then
4845 hardcode_libdirs="$libdir"
4846 else
4847 # Just accumulate the unique libdirs.
4848 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4849 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4852 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4854 esac
4856 else
4857 eval flag=\"$hardcode_libdir_flag_spec\"
4858 rpath="$rpath $flag"
4860 elif test -n "$runpath_var"; then
4861 case "$perm_rpath " in
4862 *" $libdir "*) ;;
4863 *) perm_rpath="$perm_rpath $libdir" ;;
4864 esac
4866 case $host in
4867 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4868 testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
4869 case :$dllsearchpath: in
4870 *":$libdir:"*) ;;
4871 *) dllsearchpath="$dllsearchpath:$libdir";;
4872 esac
4873 case :$dllsearchpath: in
4874 *":$testbindir:"*) ;;
4875 *) dllsearchpath="$dllsearchpath:$testbindir";;
4876 esac
4878 esac
4879 done
4880 # Substitute the hardcoded libdirs into the rpath.
4881 if test -n "$hardcode_libdir_separator" &&
4882 test -n "$hardcode_libdirs"; then
4883 libdir="$hardcode_libdirs"
4884 eval rpath=\" $hardcode_libdir_flag_spec\"
4886 compile_rpath="$rpath"
4888 rpath=
4889 hardcode_libdirs=
4890 for libdir in $finalize_rpath; do
4891 if test -n "$hardcode_libdir_flag_spec"; then
4892 if test -n "$hardcode_libdir_separator"; then
4893 if test -z "$hardcode_libdirs"; then
4894 hardcode_libdirs="$libdir"
4895 else
4896 # Just accumulate the unique libdirs.
4897 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4898 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4901 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4903 esac
4905 else
4906 eval flag=\"$hardcode_libdir_flag_spec\"
4907 rpath="$rpath $flag"
4909 elif test -n "$runpath_var"; then
4910 case "$finalize_perm_rpath " in
4911 *" $libdir "*) ;;
4912 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4913 esac
4915 done
4916 # Substitute the hardcoded libdirs into the rpath.
4917 if test -n "$hardcode_libdir_separator" &&
4918 test -n "$hardcode_libdirs"; then
4919 libdir="$hardcode_libdirs"
4920 eval rpath=\" $hardcode_libdir_flag_spec\"
4922 finalize_rpath="$rpath"
4924 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4925 # Transform all the library objects into standard objects.
4926 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4927 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4930 dlsyms=
4931 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4932 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4933 dlsyms="${outputname}S.c"
4934 else
4935 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4939 if test -n "$dlsyms"; then
4940 case $dlsyms in
4941 "") ;;
4942 *.c)
4943 # Discover the nlist of each of the dlfiles.
4944 nlist="$output_objdir/${outputname}.nm"
4946 $show "$rm $nlist ${nlist}S ${nlist}T"
4947 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4949 # Parse the name list into a source file.
4950 $show "creating $output_objdir/$dlsyms"
4952 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4953 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4954 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4956 #ifdef __cplusplus
4957 extern \"C\" {
4958 #endif
4960 /* Prevent the only kind of declaration conflicts we can make. */
4961 #define lt_preloaded_symbols some_other_symbol
4963 /* External symbol declarations for the compiler. */\
4966 if test "$dlself" = yes; then
4967 $show "generating symbol list for \`$output'"
4969 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4971 # Add our own program objects to the symbol list.
4972 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4973 for arg in $progfiles; do
4974 $show "extracting global C symbols from \`$arg'"
4975 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4976 done
4978 if test -n "$exclude_expsyms"; then
4979 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4980 $run eval '$mv "$nlist"T "$nlist"'
4983 if test -n "$export_symbols_regex"; then
4984 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4985 $run eval '$mv "$nlist"T "$nlist"'
4988 # Prepare the list of exported symbols
4989 if test -z "$export_symbols"; then
4990 export_symbols="$output_objdir/$outputname.exp"
4991 $run $rm $export_symbols
4992 $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4993 case $host in
4994 *cygwin* | *mingw* )
4995 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4996 $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4998 esac
4999 else
5000 $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
5001 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
5002 $run eval 'mv "$nlist"T "$nlist"'
5003 case $host in
5004 *cygwin* | *mingw* )
5005 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
5006 $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
5008 esac
5012 for arg in $dlprefiles; do
5013 $show "extracting global C symbols from \`$arg'"
5014 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
5015 $run eval '$echo ": $name " >> "$nlist"'
5016 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
5017 done
5019 if test -z "$run"; then
5020 # Make sure we have at least an empty file.
5021 test -f "$nlist" || : > "$nlist"
5023 if test -n "$exclude_expsyms"; then
5024 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
5025 $mv "$nlist"T "$nlist"
5028 # Try sorting and uniquifying the output.
5029 if grep -v "^: " < "$nlist" |
5030 if sort -k 3 </dev/null >/dev/null 2>&1; then
5031 sort -k 3
5032 else
5033 sort +2
5034 fi |
5035 uniq > "$nlist"S; then
5037 else
5038 grep -v "^: " < "$nlist" > "$nlist"S
5041 if test -f "$nlist"S; then
5042 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
5043 else
5044 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
5047 $echo >> "$output_objdir/$dlsyms" "\
5049 #undef lt_preloaded_symbols
5051 #if defined (__STDC__) && __STDC__
5052 # define lt_ptr void *
5053 #else
5054 # define lt_ptr char *
5055 # define const
5056 #endif
5058 /* The mapping between symbol names and symbols. */
5061 case $host in
5062 *cygwin* | *mingw* )
5063 $echo >> "$output_objdir/$dlsyms" "\
5064 /* DATA imports from DLLs on WIN32 can't be const, because
5065 runtime relocations are performed -- see ld's documentation
5066 on pseudo-relocs */
5067 struct {
5071 $echo >> "$output_objdir/$dlsyms" "\
5072 const struct {
5075 esac
5078 $echo >> "$output_objdir/$dlsyms" "\
5079 const char *name;
5080 lt_ptr address;
5082 lt_preloaded_symbols[] =
5086 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
5088 $echo >> "$output_objdir/$dlsyms" "\
5089 {0, (lt_ptr) 0}
5092 /* This works around a problem in FreeBSD linker */
5093 #ifdef FREEBSD_WORKAROUND
5094 static const void *lt_preloaded_setup() {
5095 return lt_preloaded_symbols;
5097 #endif
5099 #ifdef __cplusplus
5101 #endif\
5105 pic_flag_for_symtable=
5106 case $host in
5107 # compiling the symbol table file with pic_flag works around
5108 # a FreeBSD bug that causes programs to crash when -lm is
5109 # linked before any other PIC object. But we must not use
5110 # pic_flag when linking with -static. The problem exists in
5111 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
5112 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
5113 case "$compile_command " in
5114 *" -static "*) ;;
5115 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
5116 esac;;
5117 *-*-hpux*)
5118 case "$compile_command " in
5119 *" -static "*) ;;
5120 *) pic_flag_for_symtable=" $pic_flag";;
5121 esac
5122 esac
5124 # Now compile the dynamic symbol file.
5125 $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
5126 $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
5128 # Clean up the generated files.
5129 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
5130 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
5132 # Transform the symbol file into the correct name.
5133 case $host in
5134 *cygwin* | *mingw* )
5135 if test -f "$output_objdir/${outputname}.def" ; then
5136 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
5137 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
5138 else
5139 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
5140 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
5144 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
5145 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
5147 esac
5150 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
5151 exit $EXIT_FAILURE
5153 esac
5154 else
5155 # We keep going just in case the user didn't refer to
5156 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
5157 # really was required.
5159 # Nullify the symbol file.
5160 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
5161 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
5164 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
5165 # Replace the output file specification.
5166 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
5167 link_command="$compile_command$compile_rpath"
5169 # We have no uninstalled library dependencies, so finalize right now.
5170 $show "$link_command"
5171 $run eval "$link_command"
5172 exit_status=$?
5174 # Delete the generated files.
5175 if test -n "$dlsyms"; then
5176 $show "$rm $output_objdir/${outputname}S.${objext}"
5177 $run $rm "$output_objdir/${outputname}S.${objext}"
5180 exit $exit_status
5183 if test -n "$shlibpath_var"; then
5184 # We should set the shlibpath_var
5185 rpath=
5186 for dir in $temp_rpath; do
5187 case $dir in
5188 [\\/]* | [A-Za-z]:[\\/]*)
5189 # Absolute path.
5190 rpath="$rpath$dir:"
5193 # Relative path: add a thisdir entry.
5194 rpath="$rpath\$thisdir/$dir:"
5196 esac
5197 done
5198 temp_rpath="$rpath"
5201 if test -n "$compile_shlibpath$finalize_shlibpath"; then
5202 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
5204 if test -n "$finalize_shlibpath"; then
5205 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
5208 compile_var=
5209 finalize_var=
5210 if test -n "$runpath_var"; then
5211 if test -n "$perm_rpath"; then
5212 # We should set the runpath_var.
5213 rpath=
5214 for dir in $perm_rpath; do
5215 rpath="$rpath$dir:"
5216 done
5217 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
5219 if test -n "$finalize_perm_rpath"; then
5220 # We should set the runpath_var.
5221 rpath=
5222 for dir in $finalize_perm_rpath; do
5223 rpath="$rpath$dir:"
5224 done
5225 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
5229 if test "$no_install" = yes; then
5230 # We don't need to create a wrapper script.
5231 link_command="$compile_var$compile_command$compile_rpath"
5232 # Replace the output file specification.
5233 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
5234 # Delete the old output file.
5235 $run $rm $output
5236 # Link the executable and exit
5237 $show "$link_command"
5238 $run eval "$link_command" || exit $?
5239 exit $EXIT_SUCCESS
5242 if test "$hardcode_action" = relink; then
5243 # Fast installation is not supported
5244 link_command="$compile_var$compile_command$compile_rpath"
5245 relink_command="$finalize_var$finalize_command$finalize_rpath"
5247 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
5248 $echo "$modename: \`$output' will be relinked during installation" 1>&2
5249 else
5250 if test "$fast_install" != no; then
5251 link_command="$finalize_var$compile_command$finalize_rpath"
5252 if test "$fast_install" = yes; then
5253 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
5254 else
5255 # fast_install is set to needless
5256 relink_command=
5258 else
5259 link_command="$compile_var$compile_command$compile_rpath"
5260 relink_command="$finalize_var$finalize_command$finalize_rpath"
5264 # Replace the output file specification.
5265 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
5267 # Delete the old output files.
5268 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
5270 $show "$link_command"
5271 $run eval "$link_command" || exit $?
5273 # Now create the wrapper script.
5274 $show "creating $output"
5276 # Quote the relink command for shipping.
5277 if test -n "$relink_command"; then
5278 # Preserve any variables that may affect compiler behavior
5279 for var in $variables_saved_for_relink; do
5280 if eval test -z \"\${$var+set}\"; then
5281 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5282 elif eval var_value=\$$var; test -z "$var_value"; then
5283 relink_command="$var=; export $var; $relink_command"
5284 else
5285 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5286 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5288 done
5289 relink_command="(cd `pwd`; $relink_command)"
5290 relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
5293 # Quote $echo for shipping.
5294 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
5295 case $progpath in
5296 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
5297 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
5298 esac
5299 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
5300 else
5301 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
5304 # Only actually do things if our run command is non-null.
5305 if test -z "$run"; then
5306 # win32 will think the script is a binary if it has
5307 # a .exe suffix, so we strip it off here.
5308 case $output in
5309 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
5310 esac
5311 # test for cygwin because mv fails w/o .exe extensions
5312 case $host in
5313 *cygwin*)
5314 exeext=.exe
5315 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
5316 *) exeext= ;;
5317 esac
5318 case $host in
5319 *cygwin* | *mingw* )
5320 output_name=`basename $output`
5321 output_path=`dirname $output`
5322 cwrappersource="$output_path/$objdir/lt-$output_name.c"
5323 cwrapper="$output_path/$output_name.exe"
5324 $rm $cwrappersource $cwrapper
5325 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
5327 cat > $cwrappersource <<EOF
5329 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
5330 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5332 The $output program cannot be directly executed until all the libtool
5333 libraries that it depends on are installed.
5335 This wrapper executable should never be moved out of the build directory.
5336 If it is, it will not operate correctly.
5338 Currently, it simply execs the wrapper *script* "/bin/sh $output",
5339 but could eventually absorb all of the scripts functionality and
5340 exec $objdir/$outputname directly.
5343 cat >> $cwrappersource<<"EOF"
5344 #include <stdio.h>
5345 #include <stdlib.h>
5346 #include <unistd.h>
5347 #include <malloc.h>
5348 #include <stdarg.h>
5349 #include <assert.h>
5350 #include <string.h>
5351 #include <ctype.h>
5352 #include <sys/stat.h>
5354 #if defined(PATH_MAX)
5355 # define LT_PATHMAX PATH_MAX
5356 #elif defined(MAXPATHLEN)
5357 # define LT_PATHMAX MAXPATHLEN
5358 #else
5359 # define LT_PATHMAX 1024
5360 #endif
5362 #ifndef DIR_SEPARATOR
5363 # define DIR_SEPARATOR '/'
5364 # define PATH_SEPARATOR ':'
5365 #endif
5367 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
5368 defined (__OS2__)
5369 # define HAVE_DOS_BASED_FILE_SYSTEM
5370 # ifndef DIR_SEPARATOR_2
5371 # define DIR_SEPARATOR_2 '\\'
5372 # endif
5373 # ifndef PATH_SEPARATOR_2
5374 # define PATH_SEPARATOR_2 ';'
5375 # endif
5376 #endif
5378 #ifndef DIR_SEPARATOR_2
5379 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
5380 #else /* DIR_SEPARATOR_2 */
5381 # define IS_DIR_SEPARATOR(ch) \
5382 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
5383 #endif /* DIR_SEPARATOR_2 */
5385 #ifndef PATH_SEPARATOR_2
5386 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
5387 #else /* PATH_SEPARATOR_2 */
5388 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
5389 #endif /* PATH_SEPARATOR_2 */
5391 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
5392 #define XFREE(stale) do { \
5393 if (stale) { free ((void *) stale); stale = 0; } \
5394 } while (0)
5396 /* -DDEBUG is fairly common in CFLAGS. */
5397 #undef DEBUG
5398 #if defined DEBUGWRAPPER
5399 # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
5400 #else
5401 # define DEBUG(format, ...)
5402 #endif
5404 const char *program_name = NULL;
5406 void * xmalloc (size_t num);
5407 char * xstrdup (const char *string);
5408 const char * base_name (const char *name);
5409 char * find_executable(const char *wrapper);
5410 int check_executable(const char *path);
5411 char * strendzap(char *str, const char *pat);
5412 void lt_fatal (const char *message, ...);
5415 main (int argc, char *argv[])
5417 char **newargz;
5418 int i;
5420 program_name = (char *) xstrdup (base_name (argv[0]));
5421 DEBUG("(main) argv[0] : %s\n",argv[0]);
5422 DEBUG("(main) program_name : %s\n",program_name);
5423 newargz = XMALLOC(char *, argc+2);
5426 cat >> $cwrappersource <<EOF
5427 newargz[0] = (char *) xstrdup("$SHELL");
5430 cat >> $cwrappersource <<"EOF"
5431 newargz[1] = find_executable(argv[0]);
5432 if (newargz[1] == NULL)
5433 lt_fatal("Couldn't find %s", argv[0]);
5434 DEBUG("(main) found exe at : %s\n",newargz[1]);
5435 /* we know the script has the same name, without the .exe */
5436 /* so make sure newargz[1] doesn't end in .exe */
5437 strendzap(newargz[1],".exe");
5438 for (i = 1; i < argc; i++)
5439 newargz[i+1] = xstrdup(argv[i]);
5440 newargz[argc+1] = NULL;
5442 for (i=0; i<argc+1; i++)
5444 DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
5450 case $host_os in
5451 mingw*)
5452 cat >> $cwrappersource <<EOF
5453 execv("$SHELL",(char const **)newargz);
5457 cat >> $cwrappersource <<EOF
5458 execv("$SHELL",newargz);
5461 esac
5463 cat >> $cwrappersource <<"EOF"
5464 return 127;
5467 void *
5468 xmalloc (size_t num)
5470 void * p = (void *) malloc (num);
5471 if (!p)
5472 lt_fatal ("Memory exhausted");
5474 return p;
5477 char *
5478 xstrdup (const char *string)
5480 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5484 const char *
5485 base_name (const char *name)
5487 const char *base;
5489 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5490 /* Skip over the disk name in MSDOS pathnames. */
5491 if (isalpha ((unsigned char)name[0]) && name[1] == ':')
5492 name += 2;
5493 #endif
5495 for (base = name; *name; name++)
5496 if (IS_DIR_SEPARATOR (*name))
5497 base = name + 1;
5498 return base;
5502 check_executable(const char * path)
5504 struct stat st;
5506 DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
5507 if ((!path) || (!*path))
5508 return 0;
5510 if ((stat (path, &st) >= 0) &&
5512 /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
5513 #if defined (S_IXOTH)
5514 ((st.st_mode & S_IXOTH) == S_IXOTH) ||
5515 #endif
5516 #if defined (S_IXGRP)
5517 ((st.st_mode & S_IXGRP) == S_IXGRP) ||
5518 #endif
5519 ((st.st_mode & S_IXUSR) == S_IXUSR))
5521 return 1;
5522 else
5523 return 0;
5526 /* Searches for the full path of the wrapper. Returns
5527 newly allocated full path name if found, NULL otherwise */
5528 char *
5529 find_executable (const char* wrapper)
5531 int has_slash = 0;
5532 const char* p;
5533 const char* p_next;
5534 /* static buffer for getcwd */
5535 char tmp[LT_PATHMAX + 1];
5536 int tmp_len;
5537 char* concat_name;
5539 DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
5541 if ((wrapper == NULL) || (*wrapper == '\0'))
5542 return NULL;
5544 /* Absolute path? */
5545 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5546 if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
5548 concat_name = xstrdup (wrapper);
5549 if (check_executable(concat_name))
5550 return concat_name;
5551 XFREE(concat_name);
5553 else
5555 #endif
5556 if (IS_DIR_SEPARATOR (wrapper[0]))
5558 concat_name = xstrdup (wrapper);
5559 if (check_executable(concat_name))
5560 return concat_name;
5561 XFREE(concat_name);
5563 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5565 #endif
5567 for (p = wrapper; *p; p++)
5568 if (*p == '/')
5570 has_slash = 1;
5571 break;
5573 if (!has_slash)
5575 /* no slashes; search PATH */
5576 const char* path = getenv ("PATH");
5577 if (path != NULL)
5579 for (p = path; *p; p = p_next)
5581 const char* q;
5582 size_t p_len;
5583 for (q = p; *q; q++)
5584 if (IS_PATH_SEPARATOR(*q))
5585 break;
5586 p_len = q - p;
5587 p_next = (*q == '\0' ? q : q + 1);
5588 if (p_len == 0)
5590 /* empty path: current directory */
5591 if (getcwd (tmp, LT_PATHMAX) == NULL)
5592 lt_fatal ("getcwd failed");
5593 tmp_len = strlen(tmp);
5594 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5595 memcpy (concat_name, tmp, tmp_len);
5596 concat_name[tmp_len] = '/';
5597 strcpy (concat_name + tmp_len + 1, wrapper);
5599 else
5601 concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
5602 memcpy (concat_name, p, p_len);
5603 concat_name[p_len] = '/';
5604 strcpy (concat_name + p_len + 1, wrapper);
5606 if (check_executable(concat_name))
5607 return concat_name;
5608 XFREE(concat_name);
5611 /* not found in PATH; assume curdir */
5613 /* Relative path | not found in path: prepend cwd */
5614 if (getcwd (tmp, LT_PATHMAX) == NULL)
5615 lt_fatal ("getcwd failed");
5616 tmp_len = strlen(tmp);
5617 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5618 memcpy (concat_name, tmp, tmp_len);
5619 concat_name[tmp_len] = '/';
5620 strcpy (concat_name + tmp_len + 1, wrapper);
5622 if (check_executable(concat_name))
5623 return concat_name;
5624 XFREE(concat_name);
5625 return NULL;
5628 char *
5629 strendzap(char *str, const char *pat)
5631 size_t len, patlen;
5633 assert(str != NULL);
5634 assert(pat != NULL);
5636 len = strlen(str);
5637 patlen = strlen(pat);
5639 if (patlen <= len)
5641 str += len - patlen;
5642 if (strcmp(str, pat) == 0)
5643 *str = '\0';
5645 return str;
5648 static void
5649 lt_error_core (int exit_status, const char * mode,
5650 const char * message, va_list ap)
5652 fprintf (stderr, "%s: %s: ", program_name, mode);
5653 vfprintf (stderr, message, ap);
5654 fprintf (stderr, ".\n");
5656 if (exit_status >= 0)
5657 exit (exit_status);
5660 void
5661 lt_fatal (const char *message, ...)
5663 va_list ap;
5664 va_start (ap, message);
5665 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5666 va_end (ap);
5669 # we should really use a build-platform specific compiler
5670 # here, but OTOH, the wrappers (shell script and this C one)
5671 # are only useful if you want to execute the "real" binary.
5672 # Since the "real" binary is built for $host, then this
5673 # wrapper might as well be built for $host, too.
5674 $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
5676 esac
5677 $rm $output
5678 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5680 $echo > $output "\
5681 #! $SHELL
5683 # $output - temporary wrapper script for $objdir/$outputname
5684 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5686 # The $output program cannot be directly executed until all the libtool
5687 # libraries that it depends on are installed.
5689 # This wrapper script should never be moved out of the build directory.
5690 # If it is, it will not operate correctly.
5692 # Sed substitution that helps us do robust quoting. It backslashifies
5693 # metacharacters that are still active within double-quoted strings.
5694 Xsed='${SED} -e 1s/^X//'
5695 sed_quote_subst='$sed_quote_subst'
5697 # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
5698 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
5699 emulate sh
5700 NULLCMD=:
5701 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
5702 # is contrary to our usage. Disable this feature.
5703 alias -g '\${1+\"\$@\"}'='\"\$@\"'
5704 setopt NO_GLOB_SUBST
5705 else
5706 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
5708 BIN_SH=xpg4; export BIN_SH # for Tru64
5709 DUALCASE=1; export DUALCASE # for MKS sh
5711 # The HP-UX ksh and POSIX shell print the target directory to stdout
5712 # if CDPATH is set.
5713 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5715 relink_command=\"$relink_command\"
5717 # This environment variable determines our operation mode.
5718 if test \"\$libtool_install_magic\" = \"$magic\"; then
5719 # install mode needs the following variable:
5720 notinst_deplibs='$notinst_deplibs'
5721 else
5722 # When we are sourced in execute mode, \$file and \$echo are already set.
5723 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5724 echo=\"$qecho\"
5725 file=\"\$0\"
5726 # Make sure echo works.
5727 if test \"X\$1\" = X--no-reexec; then
5728 # Discard the --no-reexec flag, and continue.
5729 shift
5730 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
5731 # Yippee, \$echo works!
5733 else
5734 # Restart under the correct shell, and then maybe \$echo will work.
5735 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5739 $echo >> $output "\
5741 # Find the directory that this script lives in.
5742 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
5743 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5745 # Follow symbolic links until we get to the real thisdir.
5746 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
5747 while test -n \"\$file\"; do
5748 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
5750 # If there was a directory component, then change thisdir.
5751 if test \"x\$destdir\" != \"x\$file\"; then
5752 case \"\$destdir\" in
5753 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5754 *) thisdir=\"\$thisdir/\$destdir\" ;;
5755 esac
5758 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
5759 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
5760 done
5762 # Try to get the absolute directory name.
5763 absdir=\`cd \"\$thisdir\" && pwd\`
5764 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5767 if test "$fast_install" = yes; then
5768 $echo >> $output "\
5769 program=lt-'$outputname'$exeext
5770 progdir=\"\$thisdir/$objdir\"
5772 if test ! -f \"\$progdir/\$program\" || \\
5773 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5774 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5776 file=\"\$\$-\$program\"
5778 if test ! -d \"\$progdir\"; then
5779 $mkdir \"\$progdir\"
5780 else
5781 $rm \"\$progdir/\$file\"
5784 $echo >> $output "\
5786 # relink executable if necessary
5787 if test -n \"\$relink_command\"; then
5788 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5789 else
5790 $echo \"\$relink_command_output\" >&2
5791 $rm \"\$progdir/\$file\"
5792 exit $EXIT_FAILURE
5796 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5797 { $rm \"\$progdir/\$program\";
5798 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5799 $rm \"\$progdir/\$file\"
5801 else
5802 $echo >> $output "\
5803 program='$outputname'
5804 progdir=\"\$thisdir/$objdir\"
5808 $echo >> $output "\
5810 if test -f \"\$progdir/\$program\"; then"
5812 # Export our shlibpath_var if we have one.
5813 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5814 $echo >> $output "\
5815 # Add our own library path to $shlibpath_var
5816 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5818 # Some systems cannot cope with colon-terminated $shlibpath_var
5819 # The second colon is a workaround for a bug in BeOS R4 sed
5820 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5822 export $shlibpath_var
5826 # fixup the dll searchpath if we need to.
5827 if test -n "$dllsearchpath"; then
5828 $echo >> $output "\
5829 # Add the dll search path components to the executable PATH
5830 PATH=$dllsearchpath:\$PATH
5834 $echo >> $output "\
5835 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5836 # Run the actual program with our arguments.
5838 case $host in
5839 # Backslashes separate directories on plain windows
5840 *-*-mingw | *-*-os2*)
5841 $echo >> $output "\
5842 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5847 $echo >> $output "\
5848 exec \"\$progdir/\$program\" \${1+\"\$@\"}
5851 esac
5852 $echo >> $output "\
5853 \$echo \"\$0: cannot exec \$program \$*\"
5854 exit $EXIT_FAILURE
5856 else
5857 # The program doesn't exist.
5858 \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
5859 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5860 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5861 exit $EXIT_FAILURE
5865 chmod +x $output
5867 exit $EXIT_SUCCESS
5869 esac
5871 # See if we need to build an old-fashioned archive.
5872 for oldlib in $oldlibs; do
5874 if test "$build_libtool_libs" = convenience; then
5875 oldobjs="$libobjs_save"
5876 addlibs="$convenience"
5877 build_libtool_libs=no
5878 else
5879 if test "$build_libtool_libs" = module; then
5880 oldobjs="$libobjs_save"
5881 build_libtool_libs=no
5882 else
5883 oldobjs="$old_deplibs $non_pic_objects"
5885 addlibs="$old_convenience"
5888 if test -n "$addlibs"; then
5889 gentop="$output_objdir/${outputname}x"
5890 generated="$generated $gentop"
5892 func_extract_archives $gentop $addlibs
5893 oldobjs="$oldobjs $func_extract_archives_result"
5896 # Do each command in the archive commands.
5897 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5898 cmds=$old_archive_from_new_cmds
5899 else
5900 # POSIX demands no paths to be encoded in archives. We have
5901 # to avoid creating archives with duplicate basenames if we
5902 # might have to extract them afterwards, e.g., when creating a
5903 # static archive out of a convenience library, or when linking
5904 # the entirety of a libtool archive into another (currently
5905 # not supported by libtool).
5906 if (for obj in $oldobjs
5908 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5909 done | sort | sort -uc >/dev/null 2>&1); then
5911 else
5912 $echo "copying selected object files to avoid basename conflicts..."
5914 if test -z "$gentop"; then
5915 gentop="$output_objdir/${outputname}x"
5916 generated="$generated $gentop"
5918 $show "${rm}r $gentop"
5919 $run ${rm}r "$gentop"
5920 $show "$mkdir $gentop"
5921 $run $mkdir "$gentop"
5922 exit_status=$?
5923 if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
5924 exit $exit_status
5928 save_oldobjs=$oldobjs
5929 oldobjs=
5930 counter=1
5931 for obj in $save_oldobjs
5933 objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
5934 case " $oldobjs " in
5935 " ") oldobjs=$obj ;;
5936 *[\ /]"$objbase "*)
5937 while :; do
5938 # Make sure we don't pick an alternate name that also
5939 # overlaps.
5940 newobj=lt$counter-$objbase
5941 counter=`expr $counter + 1`
5942 case " $oldobjs " in
5943 *[\ /]"$newobj "*) ;;
5944 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
5945 esac
5946 done
5947 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5948 $run ln "$obj" "$gentop/$newobj" ||
5949 $run cp "$obj" "$gentop/$newobj"
5950 oldobjs="$oldobjs $gentop/$newobj"
5952 *) oldobjs="$oldobjs $obj" ;;
5953 esac
5954 done
5957 eval cmds=\"$old_archive_cmds\"
5959 if len=`expr "X$cmds" : ".*"` &&
5960 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5961 cmds=$old_archive_cmds
5962 else
5963 # the command line is too long to link in one step, link in parts
5964 $echo "using piecewise archive linking..."
5965 save_RANLIB=$RANLIB
5966 RANLIB=:
5967 objlist=
5968 concat_cmds=
5969 save_oldobjs=$oldobjs
5971 # Is there a better way of finding the last object in the list?
5972 for obj in $save_oldobjs
5974 last_oldobj=$obj
5975 done
5976 for obj in $save_oldobjs
5978 oldobjs="$objlist $obj"
5979 objlist="$objlist $obj"
5980 eval test_cmds=\"$old_archive_cmds\"
5981 if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
5982 test "$len" -le "$max_cmd_len"; then
5984 else
5985 # the above command should be used before it gets too long
5986 oldobjs=$objlist
5987 if test "$obj" = "$last_oldobj" ; then
5988 RANLIB=$save_RANLIB
5990 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5991 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5992 objlist=
5994 done
5995 RANLIB=$save_RANLIB
5996 oldobjs=$objlist
5997 if test "X$oldobjs" = "X" ; then
5998 eval cmds=\"\$concat_cmds\"
5999 else
6000 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
6004 save_ifs="$IFS"; IFS='~'
6005 for cmd in $cmds; do
6006 eval cmd=\"$cmd\"
6007 IFS="$save_ifs"
6008 $show "$cmd"
6009 $run eval "$cmd" || exit $?
6010 done
6011 IFS="$save_ifs"
6012 done
6014 if test -n "$generated"; then
6015 $show "${rm}r$generated"
6016 $run ${rm}r$generated
6019 # Now create the libtool archive.
6020 case $output in
6021 *.la)
6022 old_library=
6023 test "$build_old_libs" = yes && old_library="$libname.$libext"
6024 $show "creating $output"
6026 # Preserve any variables that may affect compiler behavior
6027 for var in $variables_saved_for_relink; do
6028 if eval test -z \"\${$var+set}\"; then
6029 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
6030 elif eval var_value=\$$var; test -z "$var_value"; then
6031 relink_command="$var=; export $var; $relink_command"
6032 else
6033 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
6034 relink_command="$var=\"$var_value\"; export $var; $relink_command"
6036 done
6037 # Quote the link command for shipping.
6038 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
6039 relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
6040 if test "$hardcode_automatic" = yes ; then
6041 relink_command=
6045 # Only create the output if not a dry run.
6046 if test -z "$run"; then
6047 for installed in no yes; do
6048 if test "$installed" = yes; then
6049 if test -z "$install_libdir"; then
6050 break
6052 output="$output_objdir/$outputname"i
6053 # Replace all uninstalled libtool libraries with the installed ones
6054 newdependency_libs=
6055 for deplib in $dependency_libs; do
6056 case $deplib in
6057 *.la)
6058 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
6059 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
6060 if test -z "$libdir"; then
6061 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
6062 exit $EXIT_FAILURE
6064 newdependency_libs="$newdependency_libs $libdir/$name"
6066 *) newdependency_libs="$newdependency_libs $deplib" ;;
6067 esac
6068 done
6069 dependency_libs="$newdependency_libs"
6070 newdlfiles=
6071 for lib in $dlfiles; do
6072 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
6073 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
6074 if test -z "$libdir"; then
6075 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6076 exit $EXIT_FAILURE
6078 newdlfiles="$newdlfiles $libdir/$name"
6079 done
6080 dlfiles="$newdlfiles"
6081 newdlprefiles=
6082 for lib in $dlprefiles; do
6083 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
6084 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
6085 if test -z "$libdir"; then
6086 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6087 exit $EXIT_FAILURE
6089 newdlprefiles="$newdlprefiles $libdir/$name"
6090 done
6091 dlprefiles="$newdlprefiles"
6092 else
6093 newdlfiles=
6094 for lib in $dlfiles; do
6095 case $lib in
6096 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
6097 *) abs=`pwd`"/$lib" ;;
6098 esac
6099 newdlfiles="$newdlfiles $abs"
6100 done
6101 dlfiles="$newdlfiles"
6102 newdlprefiles=
6103 for lib in $dlprefiles; do
6104 case $lib in
6105 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
6106 *) abs=`pwd`"/$lib" ;;
6107 esac
6108 newdlprefiles="$newdlprefiles $abs"
6109 done
6110 dlprefiles="$newdlprefiles"
6112 $rm $output
6113 # place dlname in correct position for cygwin
6114 tdlname=$dlname
6115 case $host,$output,$installed,$module,$dlname in
6116 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
6117 esac
6118 $echo > $output "\
6119 # $outputname - a libtool library file
6120 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
6122 # Please DO NOT delete this file!
6123 # It is necessary for linking the library.
6125 # The name that we can dlopen(3).
6126 dlname='$tdlname'
6128 # Names of this library.
6129 library_names='$library_names'
6131 # The name of the static archive.
6132 old_library='$old_library'
6134 # Libraries that this one depends upon.
6135 dependency_libs='$dependency_libs'
6137 # Version information for $libname.
6138 current=$current
6139 age=$age
6140 revision=$revision
6142 # Is this an already installed library?
6143 installed=$installed
6145 # Should we warn about portability when linking against -modules?
6146 shouldnotlink=$module
6148 # Files to dlopen/dlpreopen
6149 dlopen='$dlfiles'
6150 dlpreopen='$dlprefiles'
6152 # Directory that this library needs to be installed in:
6153 libdir='$install_libdir'"
6154 if test "$installed" = no && test "$need_relink" = yes; then
6155 $echo >> $output "\
6156 relink_command=\"$relink_command\""
6158 done
6161 # Do a symbolic link so that the libtool archive can be found in
6162 # LD_LIBRARY_PATH before the program is installed.
6163 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
6164 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
6166 esac
6167 exit $EXIT_SUCCESS
6170 # libtool install mode
6171 install)
6172 modename="$modename: install"
6174 # There may be an optional sh(1) argument at the beginning of
6175 # install_prog (especially on Windows NT).
6176 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
6177 # Allow the use of GNU shtool's install command.
6178 $echo "X$nonopt" | grep shtool > /dev/null; then
6179 # Aesthetically quote it.
6180 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
6181 case $arg in
6182 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6183 arg="\"$arg\""
6185 esac
6186 install_prog="$arg "
6187 arg="$1"
6188 shift
6189 else
6190 install_prog=
6191 arg=$nonopt
6194 # The real first argument should be the name of the installation program.
6195 # Aesthetically quote it.
6196 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
6197 case $arg in
6198 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6199 arg="\"$arg\""
6201 esac
6202 install_prog="$install_prog$arg"
6204 # We need to accept at least all the BSD install flags.
6205 dest=
6206 files=
6207 opts=
6208 prev=
6209 install_type=
6210 isdir=no
6211 stripme=
6212 for arg
6214 if test -n "$dest"; then
6215 files="$files $dest"
6216 dest=$arg
6217 continue
6220 case $arg in
6221 -d) isdir=yes ;;
6222 -f)
6223 case " $install_prog " in
6224 *[\\\ /]cp\ *) ;;
6225 *) prev=$arg ;;
6226 esac
6228 -g | -m | -o) prev=$arg ;;
6230 stripme=" -s"
6231 continue
6236 # If the previous option needed an argument, then skip it.
6237 if test -n "$prev"; then
6238 prev=
6239 else
6240 dest=$arg
6241 continue
6244 esac
6246 # Aesthetically quote the argument.
6247 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
6248 case $arg in
6249 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6250 arg="\"$arg\""
6252 esac
6253 install_prog="$install_prog $arg"
6254 done
6256 if test -z "$install_prog"; then
6257 $echo "$modename: you must specify an install program" 1>&2
6258 $echo "$help" 1>&2
6259 exit $EXIT_FAILURE
6262 if test -n "$prev"; then
6263 $echo "$modename: the \`$prev' option requires an argument" 1>&2
6264 $echo "$help" 1>&2
6265 exit $EXIT_FAILURE
6268 if test -z "$files"; then
6269 if test -z "$dest"; then
6270 $echo "$modename: no file or destination specified" 1>&2
6271 else
6272 $echo "$modename: you must specify a destination" 1>&2
6274 $echo "$help" 1>&2
6275 exit $EXIT_FAILURE
6278 # Strip any trailing slash from the destination.
6279 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
6281 # Check to see that the destination is a directory.
6282 test -d "$dest" && isdir=yes
6283 if test "$isdir" = yes; then
6284 destdir="$dest"
6285 destname=
6286 else
6287 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
6288 test "X$destdir" = "X$dest" && destdir=.
6289 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
6291 # Not a directory, so check to see that there is only one file specified.
6292 set dummy $files
6293 if test "$#" -gt 2; then
6294 $echo "$modename: \`$dest' is not a directory" 1>&2
6295 $echo "$help" 1>&2
6296 exit $EXIT_FAILURE
6299 case $destdir in
6300 [\\/]* | [A-Za-z]:[\\/]*) ;;
6302 for file in $files; do
6303 case $file in
6304 *.lo) ;;
6306 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
6307 $echo "$help" 1>&2
6308 exit $EXIT_FAILURE
6310 esac
6311 done
6313 esac
6315 # This variable tells wrapper scripts just to set variables rather
6316 # than running their programs.
6317 libtool_install_magic="$magic"
6319 staticlibs=
6320 future_libdirs=
6321 current_libdirs=
6322 for file in $files; do
6324 # Do each installation.
6325 case $file in
6326 *.$libext)
6327 # Do the static libraries later.
6328 staticlibs="$staticlibs $file"
6331 *.la)
6332 # Check to see that this really is a libtool archive.
6333 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6334 else
6335 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
6336 $echo "$help" 1>&2
6337 exit $EXIT_FAILURE
6340 library_names=
6341 old_library=
6342 relink_command=
6343 # If there is no directory component, then add one.
6344 case $file in
6345 */* | *\\*) . $file ;;
6346 *) . ./$file ;;
6347 esac
6349 # Add the libdir to current_libdirs if it is the destination.
6350 if test "X$destdir" = "X$libdir"; then
6351 case "$current_libdirs " in
6352 *" $libdir "*) ;;
6353 *) current_libdirs="$current_libdirs $libdir" ;;
6354 esac
6355 else
6356 # Note the libdir as a future libdir.
6357 case "$future_libdirs " in
6358 *" $libdir "*) ;;
6359 *) future_libdirs="$future_libdirs $libdir" ;;
6360 esac
6363 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
6364 test "X$dir" = "X$file/" && dir=
6365 dir="$dir$objdir"
6367 if test -n "$relink_command"; then
6368 # Determine the prefix the user has applied to our future dir.
6369 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
6371 # Don't allow the user to place us outside of our expected
6372 # location b/c this prevents finding dependent libraries that
6373 # are installed to the same prefix.
6374 # At present, this check doesn't affect windows .dll's that
6375 # are installed into $libdir/../bin (currently, that works fine)
6376 # but it's something to keep an eye on.
6377 if test "$inst_prefix_dir" = "$destdir"; then
6378 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
6379 exit $EXIT_FAILURE
6382 if test -n "$inst_prefix_dir"; then
6383 # Stick the inst_prefix_dir data into the link command.
6384 relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
6385 else
6386 relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
6389 $echo "$modename: warning: relinking \`$file'" 1>&2
6390 $show "$relink_command"
6391 if $run eval "$relink_command"; then :
6392 else
6393 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6394 exit $EXIT_FAILURE
6398 # See the names of the shared library.
6399 set dummy $library_names
6400 if test -n "$2"; then
6401 realname="$2"
6402 shift
6403 shift
6405 srcname="$realname"
6406 test -n "$relink_command" && srcname="$realname"T
6408 # Install the shared library and build the symlinks.
6409 $show "$install_prog $dir/$srcname $destdir/$realname"
6410 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
6411 if test -n "$stripme" && test -n "$striplib"; then
6412 $show "$striplib $destdir/$realname"
6413 $run eval "$striplib $destdir/$realname" || exit $?
6416 if test "$#" -gt 0; then
6417 # Delete the old symlinks, and create new ones.
6418 # Try `ln -sf' first, because the `ln' binary might depend on
6419 # the symlink we replace! Solaris /bin/ln does not understand -f,
6420 # so we also need to try rm && ln -s.
6421 for linkname
6423 if test "$linkname" != "$realname"; then
6424 $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6425 $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6427 done
6430 # Do each command in the postinstall commands.
6431 lib="$destdir/$realname"
6432 cmds=$postinstall_cmds
6433 save_ifs="$IFS"; IFS='~'
6434 for cmd in $cmds; do
6435 IFS="$save_ifs"
6436 eval cmd=\"$cmd\"
6437 $show "$cmd"
6438 $run eval "$cmd" || {
6439 lt_exit=$?
6441 # Restore the uninstalled library and exit
6442 if test "$mode" = relink; then
6443 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
6446 exit $lt_exit
6448 done
6449 IFS="$save_ifs"
6452 # Install the pseudo-library for information purposes.
6453 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6454 instname="$dir/$name"i
6455 $show "$install_prog $instname $destdir/$name"
6456 $run eval "$install_prog $instname $destdir/$name" || exit $?
6458 # Maybe install the static library, too.
6459 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
6462 *.lo)
6463 # Install (i.e. copy) a libtool object.
6465 # Figure out destination file name, if it wasn't already specified.
6466 if test -n "$destname"; then
6467 destfile="$destdir/$destname"
6468 else
6469 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6470 destfile="$destdir/$destfile"
6473 # Deduce the name of the destination old-style object file.
6474 case $destfile in
6475 *.lo)
6476 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
6478 *.$objext)
6479 staticdest="$destfile"
6480 destfile=
6483 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
6484 $echo "$help" 1>&2
6485 exit $EXIT_FAILURE
6487 esac
6489 # Install the libtool object if requested.
6490 if test -n "$destfile"; then
6491 $show "$install_prog $file $destfile"
6492 $run eval "$install_prog $file $destfile" || exit $?
6495 # Install the old object if enabled.
6496 if test "$build_old_libs" = yes; then
6497 # Deduce the name of the old-style object file.
6498 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
6500 $show "$install_prog $staticobj $staticdest"
6501 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
6503 exit $EXIT_SUCCESS
6507 # Figure out destination file name, if it wasn't already specified.
6508 if test -n "$destname"; then
6509 destfile="$destdir/$destname"
6510 else
6511 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6512 destfile="$destdir/$destfile"
6515 # If the file is missing, and there is a .exe on the end, strip it
6516 # because it is most likely a libtool script we actually want to
6517 # install
6518 stripped_ext=""
6519 case $file in
6520 *.exe)
6521 if test ! -f "$file"; then
6522 file=`$echo $file|${SED} 's,.exe$,,'`
6523 stripped_ext=".exe"
6526 esac
6528 # Do a test to see if this is really a libtool program.
6529 case $host in
6530 *cygwin*|*mingw*)
6531 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
6534 wrapper=$file
6536 esac
6537 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
6538 notinst_deplibs=
6539 relink_command=
6541 # Note that it is not necessary on cygwin/mingw to append a dot to
6542 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6543 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6544 # `FILE.' does not work on cygwin managed mounts.
6546 # If there is no directory component, then add one.
6547 case $wrapper in
6548 */* | *\\*) . ${wrapper} ;;
6549 *) . ./${wrapper} ;;
6550 esac
6552 # Check the variables that should have been set.
6553 if test -z "$notinst_deplibs"; then
6554 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
6555 exit $EXIT_FAILURE
6558 finalize=yes
6559 for lib in $notinst_deplibs; do
6560 # Check to see that each library is installed.
6561 libdir=
6562 if test -f "$lib"; then
6563 # If there is no directory component, then add one.
6564 case $lib in
6565 */* | *\\*) . $lib ;;
6566 *) . ./$lib ;;
6567 esac
6569 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
6570 if test -n "$libdir" && test ! -f "$libfile"; then
6571 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
6572 finalize=no
6574 done
6576 relink_command=
6577 # Note that it is not necessary on cygwin/mingw to append a dot to
6578 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6579 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6580 # `FILE.' does not work on cygwin managed mounts.
6582 # If there is no directory component, then add one.
6583 case $wrapper in
6584 */* | *\\*) . ${wrapper} ;;
6585 *) . ./${wrapper} ;;
6586 esac
6588 outputname=
6589 if test "$fast_install" = no && test -n "$relink_command"; then
6590 if test "$finalize" = yes && test -z "$run"; then
6591 tmpdir=`func_mktempdir`
6592 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6593 outputname="$tmpdir/$file"
6594 # Replace the output file specification.
6595 relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
6597 $show "$relink_command"
6598 if $run eval "$relink_command"; then :
6599 else
6600 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6601 ${rm}r "$tmpdir"
6602 continue
6604 file="$outputname"
6605 else
6606 $echo "$modename: warning: cannot relink \`$file'" 1>&2
6608 else
6609 # Install the binary that we compiled earlier.
6610 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
6614 # remove .exe since cygwin /usr/bin/install will append another
6615 # one anyway
6616 case $install_prog,$host in
6617 */usr/bin/install*,*cygwin*)
6618 case $file:$destfile in
6619 *.exe:*.exe)
6620 # this is ok
6622 *.exe:*)
6623 destfile=$destfile.exe
6625 *:*.exe)
6626 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
6628 esac
6630 esac
6631 $show "$install_prog$stripme $file $destfile"
6632 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
6633 test -n "$outputname" && ${rm}r "$tmpdir"
6635 esac
6636 done
6638 for file in $staticlibs; do
6639 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6641 # Set up the ranlib parameters.
6642 oldlib="$destdir/$name"
6644 $show "$install_prog $file $oldlib"
6645 $run eval "$install_prog \$file \$oldlib" || exit $?
6647 if test -n "$stripme" && test -n "$old_striplib"; then
6648 $show "$old_striplib $oldlib"
6649 $run eval "$old_striplib $oldlib" || exit $?
6652 # Do each command in the postinstall commands.
6653 cmds=$old_postinstall_cmds
6654 save_ifs="$IFS"; IFS='~'
6655 for cmd in $cmds; do
6656 IFS="$save_ifs"
6657 eval cmd=\"$cmd\"
6658 $show "$cmd"
6659 $run eval "$cmd" || exit $?
6660 done
6661 IFS="$save_ifs"
6662 done
6664 if test -n "$future_libdirs"; then
6665 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
6668 if test -n "$current_libdirs"; then
6669 # Maybe just do a dry run.
6670 test -n "$run" && current_libdirs=" -n$current_libdirs"
6671 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
6672 else
6673 exit $EXIT_SUCCESS
6677 # libtool finish mode
6678 finish)
6679 modename="$modename: finish"
6680 libdirs="$nonopt"
6681 admincmds=
6683 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
6684 for dir
6686 libdirs="$libdirs $dir"
6687 done
6689 for libdir in $libdirs; do
6690 if test -n "$finish_cmds"; then
6691 # Do each command in the finish commands.
6692 cmds=$finish_cmds
6693 save_ifs="$IFS"; IFS='~'
6694 for cmd in $cmds; do
6695 IFS="$save_ifs"
6696 eval cmd=\"$cmd\"
6697 $show "$cmd"
6698 $run eval "$cmd" || admincmds="$admincmds
6699 $cmd"
6700 done
6701 IFS="$save_ifs"
6703 if test -n "$finish_eval"; then
6704 # Do the single finish_eval.
6705 eval cmds=\"$finish_eval\"
6706 $run eval "$cmds" || admincmds="$admincmds
6707 $cmds"
6709 done
6712 # Exit here if they wanted silent mode.
6713 test "$show" = : && exit $EXIT_SUCCESS
6715 $echo "X----------------------------------------------------------------------" | $Xsed
6716 $echo "Libraries have been installed in:"
6717 for libdir in $libdirs; do
6718 $echo " $libdir"
6719 done
6720 $echo
6721 $echo "If you ever happen to want to link against installed libraries"
6722 $echo "in a given directory, LIBDIR, you must either use libtool, and"
6723 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6724 $echo "flag during linking and do at least one of the following:"
6725 if test -n "$shlibpath_var"; then
6726 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6727 $echo " during execution"
6729 if test -n "$runpath_var"; then
6730 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
6731 $echo " during linking"
6733 if test -n "$hardcode_libdir_flag_spec"; then
6734 libdir=LIBDIR
6735 eval flag=\"$hardcode_libdir_flag_spec\"
6737 $echo " - use the \`$flag' linker flag"
6739 if test -n "$admincmds"; then
6740 $echo " - have your system administrator run these commands:$admincmds"
6742 if test -f /etc/ld.so.conf; then
6743 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6745 $echo
6746 $echo "See any operating system documentation about shared libraries for"
6747 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6748 $echo "X----------------------------------------------------------------------" | $Xsed
6749 exit $EXIT_SUCCESS
6752 # libtool execute mode
6753 execute)
6754 modename="$modename: execute"
6756 # The first argument is the command name.
6757 cmd="$nonopt"
6758 if test -z "$cmd"; then
6759 $echo "$modename: you must specify a COMMAND" 1>&2
6760 $echo "$help"
6761 exit $EXIT_FAILURE
6764 # Handle -dlopen flags immediately.
6765 for file in $execute_dlfiles; do
6766 if test ! -f "$file"; then
6767 $echo "$modename: \`$file' is not a file" 1>&2
6768 $echo "$help" 1>&2
6769 exit $EXIT_FAILURE
6772 dir=
6773 case $file in
6774 *.la)
6775 # Check to see that this really is a libtool archive.
6776 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6777 else
6778 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6779 $echo "$help" 1>&2
6780 exit $EXIT_FAILURE
6783 # Read the libtool library.
6784 dlname=
6785 library_names=
6787 # If there is no directory component, then add one.
6788 case $file in
6789 */* | *\\*) . $file ;;
6790 *) . ./$file ;;
6791 esac
6793 # Skip this library if it cannot be dlopened.
6794 if test -z "$dlname"; then
6795 # Warn if it was a shared library.
6796 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6797 continue
6800 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6801 test "X$dir" = "X$file" && dir=.
6803 if test -f "$dir/$objdir/$dlname"; then
6804 dir="$dir/$objdir"
6805 else
6806 if test ! -f "$dir/$dlname"; then
6807 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6808 exit $EXIT_FAILURE
6813 *.lo)
6814 # Just add the directory containing the .lo file.
6815 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6816 test "X$dir" = "X$file" && dir=.
6820 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6821 continue
6823 esac
6825 # Get the absolute pathname.
6826 absdir=`cd "$dir" && pwd`
6827 test -n "$absdir" && dir="$absdir"
6829 # Now add the directory to shlibpath_var.
6830 if eval "test -z \"\$$shlibpath_var\""; then
6831 eval "$shlibpath_var=\"\$dir\""
6832 else
6833 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6835 done
6837 # This variable tells wrapper scripts just to set shlibpath_var
6838 # rather than running their programs.
6839 libtool_execute_magic="$magic"
6841 # Check if any of the arguments is a wrapper script.
6842 args=
6843 for file
6845 case $file in
6846 -*) ;;
6848 # Do a test to see if this is really a libtool program.
6849 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6850 # If there is no directory component, then add one.
6851 case $file in
6852 */* | *\\*) . $file ;;
6853 *) . ./$file ;;
6854 esac
6856 # Transform arg to wrapped name.
6857 file="$progdir/$program"
6860 esac
6861 # Quote arguments (to preserve shell metacharacters).
6862 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6863 args="$args \"$file\""
6864 done
6866 if test -z "$run"; then
6867 if test -n "$shlibpath_var"; then
6868 # Export the shlibpath_var.
6869 eval "export $shlibpath_var"
6872 # Restore saved environment variables
6873 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
6875 eval "if test \"\${save_$lt_var+set}\" = set; then
6876 $lt_var=\$save_$lt_var; export $lt_var
6878 done
6880 # Now prepare to actually exec the command.
6881 exec_cmd="\$cmd$args"
6882 else
6883 # Display what would be done.
6884 if test -n "$shlibpath_var"; then
6885 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6886 $echo "export $shlibpath_var"
6888 $echo "$cmd$args"
6889 exit $EXIT_SUCCESS
6893 # libtool clean and uninstall mode
6894 clean | uninstall)
6895 modename="$modename: $mode"
6896 rm="$nonopt"
6897 files=
6898 rmforce=
6899 exit_status=0
6901 # This variable tells wrapper scripts just to set variables rather
6902 # than running their programs.
6903 libtool_install_magic="$magic"
6905 for arg
6907 case $arg in
6908 -f) rm="$rm $arg"; rmforce=yes ;;
6909 -*) rm="$rm $arg" ;;
6910 *) files="$files $arg" ;;
6911 esac
6912 done
6914 if test -z "$rm"; then
6915 $echo "$modename: you must specify an RM program" 1>&2
6916 $echo "$help" 1>&2
6917 exit $EXIT_FAILURE
6920 rmdirs=
6922 origobjdir="$objdir"
6923 for file in $files; do
6924 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6925 if test "X$dir" = "X$file"; then
6926 dir=.
6927 objdir="$origobjdir"
6928 else
6929 objdir="$dir/$origobjdir"
6931 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6932 test "$mode" = uninstall && objdir="$dir"
6934 # Remember objdir for removal later, being careful to avoid duplicates
6935 if test "$mode" = clean; then
6936 case " $rmdirs " in
6937 *" $objdir "*) ;;
6938 *) rmdirs="$rmdirs $objdir" ;;
6939 esac
6942 # Don't error if the file doesn't exist and rm -f was used.
6943 if (test -L "$file") >/dev/null 2>&1 \
6944 || (test -h "$file") >/dev/null 2>&1 \
6945 || test -f "$file"; then
6947 elif test -d "$file"; then
6948 exit_status=1
6949 continue
6950 elif test "$rmforce" = yes; then
6951 continue
6954 rmfiles="$file"
6956 case $name in
6957 *.la)
6958 # Possibly a libtool archive, so verify it.
6959 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6960 . $dir/$name
6962 # Delete the libtool libraries and symlinks.
6963 for n in $library_names; do
6964 rmfiles="$rmfiles $objdir/$n"
6965 done
6966 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6968 case "$mode" in
6969 clean)
6970 case " $library_names " in
6971 # " " in the beginning catches empty $dlname
6972 *" $dlname "*) ;;
6973 *) rmfiles="$rmfiles $objdir/$dlname" ;;
6974 esac
6975 test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6977 uninstall)
6978 if test -n "$library_names"; then
6979 # Do each command in the postuninstall commands.
6980 cmds=$postuninstall_cmds
6981 save_ifs="$IFS"; IFS='~'
6982 for cmd in $cmds; do
6983 IFS="$save_ifs"
6984 eval cmd=\"$cmd\"
6985 $show "$cmd"
6986 $run eval "$cmd"
6987 if test "$?" -ne 0 && test "$rmforce" != yes; then
6988 exit_status=1
6990 done
6991 IFS="$save_ifs"
6994 if test -n "$old_library"; then
6995 # Do each command in the old_postuninstall commands.
6996 cmds=$old_postuninstall_cmds
6997 save_ifs="$IFS"; IFS='~'
6998 for cmd in $cmds; do
6999 IFS="$save_ifs"
7000 eval cmd=\"$cmd\"
7001 $show "$cmd"
7002 $run eval "$cmd"
7003 if test "$?" -ne 0 && test "$rmforce" != yes; then
7004 exit_status=1
7006 done
7007 IFS="$save_ifs"
7009 # FIXME: should reinstall the best remaining shared library.
7011 esac
7015 *.lo)
7016 # Possibly a libtool object, so verify it.
7017 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
7019 # Read the .lo file
7020 . $dir/$name
7022 # Add PIC object to the list of files to remove.
7023 if test -n "$pic_object" \
7024 && test "$pic_object" != none; then
7025 rmfiles="$rmfiles $dir/$pic_object"
7028 # Add non-PIC object to the list of files to remove.
7029 if test -n "$non_pic_object" \
7030 && test "$non_pic_object" != none; then
7031 rmfiles="$rmfiles $dir/$non_pic_object"
7037 if test "$mode" = clean ; then
7038 noexename=$name
7039 case $file in
7040 *.exe)
7041 file=`$echo $file|${SED} 's,.exe$,,'`
7042 noexename=`$echo $name|${SED} 's,.exe$,,'`
7043 # $file with .exe has already been added to rmfiles,
7044 # add $file without .exe
7045 rmfiles="$rmfiles $file"
7047 esac
7048 # Do a test to see if this is a libtool program.
7049 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
7050 relink_command=
7051 . $dir/$noexename
7053 # note $name still contains .exe if it was in $file originally
7054 # as does the version of $file that was added into $rmfiles
7055 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
7056 if test "$fast_install" = yes && test -n "$relink_command"; then
7057 rmfiles="$rmfiles $objdir/lt-$name"
7059 if test "X$noexename" != "X$name" ; then
7060 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
7065 esac
7066 $show "$rm $rmfiles"
7067 $run $rm $rmfiles || exit_status=1
7068 done
7069 objdir="$origobjdir"
7071 # Try to remove the ${objdir}s in the directories where we deleted files
7072 for dir in $rmdirs; do
7073 if test -d "$dir"; then
7074 $show "rmdir $dir"
7075 $run rmdir $dir >/dev/null 2>&1
7077 done
7079 exit $exit_status
7083 $echo "$modename: you must specify a MODE" 1>&2
7084 $echo "$generic_help" 1>&2
7085 exit $EXIT_FAILURE
7087 esac
7089 if test -z "$exec_cmd"; then
7090 $echo "$modename: invalid operation mode \`$mode'" 1>&2
7091 $echo "$generic_help" 1>&2
7092 exit $EXIT_FAILURE
7094 fi # test -z "$show_help"
7096 if test -n "$exec_cmd"; then
7097 eval exec $exec_cmd
7098 exit $EXIT_FAILURE
7101 # We need to display help for each of the modes.
7102 case $mode in
7103 "") $echo \
7104 "Usage: $modename [OPTION]... [MODE-ARG]...
7106 Provide generalized library-building support services.
7108 --config show all configuration variables
7109 --debug enable verbose shell tracing
7110 -n, --dry-run display commands without modifying any files
7111 --features display basic configuration information and exit
7112 --finish same as \`--mode=finish'
7113 --help display this help message and exit
7114 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
7115 --quiet same as \`--silent'
7116 --silent don't print informational messages
7117 --tag=TAG use configuration variables from tag TAG
7118 --version print version information
7120 MODE must be one of the following:
7122 clean remove files from the build directory
7123 compile compile a source file into a libtool object
7124 execute automatically set library path, then run a program
7125 finish complete the installation of libtool libraries
7126 install install libraries or executables
7127 link create a library or an executable
7128 uninstall remove libraries from an installed directory
7130 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
7131 a more detailed description of MODE.
7133 Report bugs to <bug-libtool@gnu.org>."
7134 exit $EXIT_SUCCESS
7137 clean)
7138 $echo \
7139 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
7141 Remove files from the build directory.
7143 RM is the name of the program to use to delete files associated with each FILE
7144 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
7145 to RM.
7147 If FILE is a libtool library, object or program, all the files associated
7148 with it are deleted. Otherwise, only FILE itself is deleted using RM."
7151 compile)
7152 $echo \
7153 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
7155 Compile a source file into a libtool library object.
7157 This mode accepts the following additional options:
7159 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
7160 -prefer-pic try to building PIC objects only
7161 -prefer-non-pic try to building non-PIC objects only
7162 -static always build a \`.o' file suitable for static linking
7164 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
7165 from the given SOURCEFILE.
7167 The output file name is determined by removing the directory component from
7168 SOURCEFILE, then substituting the C source code suffix \`.c' with the
7169 library object suffix, \`.lo'."
7172 execute)
7173 $echo \
7174 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
7176 Automatically set library path, then run a program.
7178 This mode accepts the following additional options:
7180 -dlopen FILE add the directory containing FILE to the library path
7182 This mode sets the library path environment variable according to \`-dlopen'
7183 flags.
7185 If any of the ARGS are libtool executable wrappers, then they are translated
7186 into their corresponding uninstalled binary, and any of their required library
7187 directories are added to the library path.
7189 Then, COMMAND is executed, with ARGS as arguments."
7192 finish)
7193 $echo \
7194 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
7196 Complete the installation of libtool libraries.
7198 Each LIBDIR is a directory that contains libtool libraries.
7200 The commands that this mode executes may require superuser privileges. Use
7201 the \`--dry-run' option if you just want to see what would be executed."
7204 install)
7205 $echo \
7206 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
7208 Install executables or libraries.
7210 INSTALL-COMMAND is the installation command. The first component should be
7211 either the \`install' or \`cp' program.
7213 The rest of the components are interpreted as arguments to that command (only
7214 BSD-compatible install options are recognized)."
7217 link)
7218 $echo \
7219 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
7221 Link object files or libraries together to form another library, or to
7222 create an executable program.
7224 LINK-COMMAND is a command using the C compiler that you would use to create
7225 a program from several object files.
7227 The following components of LINK-COMMAND are treated specially:
7229 -all-static do not do any dynamic linking at all
7230 -avoid-version do not add a version suffix if possible
7231 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
7232 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
7233 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
7234 -export-symbols SYMFILE
7235 try to export only the symbols listed in SYMFILE
7236 -export-symbols-regex REGEX
7237 try to export only the symbols matching REGEX
7238 -LLIBDIR search LIBDIR for required installed libraries
7239 -lNAME OUTPUT-FILE requires the installed library libNAME
7240 -module build a library that can dlopened
7241 -no-fast-install disable the fast-install mode
7242 -no-install link a not-installable executable
7243 -no-undefined declare that a library does not refer to external symbols
7244 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
7245 -objectlist FILE Use a list of object files found in FILE to specify objects
7246 -precious-files-regex REGEX
7247 don't remove output files matching REGEX
7248 -release RELEASE specify package release information
7249 -rpath LIBDIR the created library will eventually be installed in LIBDIR
7250 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
7251 -static do not do any dynamic linking of uninstalled libtool libraries
7252 -static-libtool-libs
7253 do not do any dynamic linking of libtool libraries
7254 -version-info CURRENT[:REVISION[:AGE]]
7255 specify library version info [each variable defaults to 0]
7257 All other options (arguments beginning with \`-') are ignored.
7259 Every other argument is treated as a filename. Files ending in \`.la' are
7260 treated as uninstalled libtool libraries, other files are standard or library
7261 object files.
7263 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
7264 only library objects (\`.lo' files) may be specified, and \`-rpath' is
7265 required, except when creating a convenience library.
7267 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
7268 using \`ar' and \`ranlib', or on Windows using \`lib'.
7270 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
7271 is created, otherwise an executable program is created."
7274 uninstall)
7275 $echo \
7276 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
7278 Remove libraries from an installation directory.
7280 RM is the name of the program to use to delete files associated with each FILE
7281 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
7282 to RM.
7284 If FILE is a libtool library, all the files associated with it are deleted.
7285 Otherwise, only FILE itself is deleted using RM."
7289 $echo "$modename: invalid operation mode \`$mode'" 1>&2
7290 $echo "$help" 1>&2
7291 exit $EXIT_FAILURE
7293 esac
7295 $echo
7296 $echo "Try \`$modename --help' for more information about other modes."
7298 exit $?
7300 # The TAGs below are defined such that we never get into a situation
7301 # in which we disable both kinds of libraries. Given conflicting
7302 # choices, we go for a static library, that is the most portable,
7303 # since we can't tell whether shared libraries were disabled because
7304 # the user asked for that or because the platform doesn't support
7305 # them. This is particularly important on AIX, because we don't
7306 # support having both static and shared libraries enabled at the same
7307 # time on that platform, so we default to a shared-only configuration.
7308 # If a disable-shared tag is given, we'll fallback to a static-only
7309 # configuration. But we'll never go from static-only to shared-only.
7311 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
7312 disable_libs=shared
7313 # ### END LIBTOOL TAG CONFIG: disable-shared
7315 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
7316 disable_libs=static
7317 # ### END LIBTOOL TAG CONFIG: disable-static
7319 # Local Variables:
7320 # mode:shell-script
7321 # sh-indentation:2
7322 # End:
7323 # ### BEGIN LIBTOOL TAG CONFIG: CXX
7325 # Libtool was configured on host Felix-Maschine:
7327 # Shell to use when invoking shell scripts.
7328 SHELL="/bin/sh"
7330 # Whether or not to build shared libraries.
7331 build_libtool_libs=yes
7333 # Whether or not to build static libraries.
7334 build_old_libs=no
7336 # Whether or not to add -lc for building shared libraries.
7337 build_libtool_need_lc=no
7339 # Whether or not to disallow shared libs when runtime libs are static
7340 allow_libtool_libs_with_static_runtimes=yes
7342 # Whether or not to optimize for fast installation.
7343 fast_install=needless
7345 # The host system.
7346 host_alias=
7347 host=i686-pc-cygwin
7348 host_os=cygwin
7350 # The build system.
7351 build_alias=i686-pc-cygwin
7352 build=i686-pc-cygwin
7353 build_os=cygwin
7355 # An echo program that does not interpret backslashes.
7356 echo="echo"
7358 # The archiver.
7359 AR="ar"
7360 AR_FLAGS="cru"
7362 # A C compiler.
7363 LTCC="gcc"
7365 # LTCC compiler flags.
7366 LTCFLAGS="-g -O2"
7368 # A language-specific compiler.
7369 CC="g++"
7371 # Is the compiler the GNU C compiler?
7372 with_gcc=yes
7374 # An ERE matcher.
7375 EGREP="/bin/grep -E"
7377 # The linker used to build libraries.
7378 LD="/i686-pc-msys/bin/ld.exe"
7380 # Whether we need hard or soft links.
7381 LN_S="cp -p"
7383 # A BSD-compatible nm program.
7384 NM="/bin/nm -B"
7386 # A symbol stripping program
7387 STRIP="strip"
7389 # Used to examine libraries when file_magic_cmd begins "file"
7390 MAGIC_CMD=file
7392 # Used on cygwin: DLL creation program.
7393 DLLTOOL="dlltool"
7395 # Used on cygwin: object dumper.
7396 OBJDUMP="objdump"
7398 # Used on cygwin: assembler.
7399 AS="as"
7401 # The name of the directory that contains temporary libtool files.
7402 objdir=.libs
7404 # How to create reloadable object files.
7405 reload_flag=" -r"
7406 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
7408 # How to pass a linker flag through the compiler.
7409 wl="-Wl,"
7411 # Object file suffix (normally "o").
7412 objext="o"
7414 # Old archive suffix (normally "a").
7415 libext="a"
7417 # Shared library suffix (normally ".so").
7418 shrext_cmds='.dll'
7420 # Executable file suffix (normally "").
7421 exeext=""
7423 # Additional compiler flags for building library objects.
7424 pic_flag=" -DDLL_EXPORT -DPIC"
7425 pic_mode=default
7427 # What is the maximum length of a command?
7428 max_cmd_len=8192
7430 # Does compiler simultaneously support -c and -o options?
7431 compiler_c_o="yes"
7433 # Must we lock files when doing compilation?
7434 need_locks="no"
7436 # Do we need the lib prefix for modules?
7437 need_lib_prefix=no
7439 # Do we need a version for libraries?
7440 need_version=no
7442 # Whether dlopen is supported.
7443 dlopen_support=unknown
7445 # Whether dlopen of programs is supported.
7446 dlopen_self=unknown
7448 # Whether dlopen of statically linked programs is supported.
7449 dlopen_self_static=unknown
7451 # Compiler flag to prevent dynamic linking.
7452 link_static_flag=""
7454 # Compiler flag to turn off builtin functions.
7455 no_builtin_flag=" -fno-builtin"
7457 # Compiler flag to allow reflexive dlopens.
7458 export_dynamic_flag_spec="\${wl}--export-dynamic"
7460 # Compiler flag to generate shared objects directly from archives.
7461 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
7463 # Compiler flag to generate thread-safe objects.
7464 thread_safe_flag_spec=""
7466 # Library versioning type.
7467 version_type=windows
7469 # Format of library name prefix.
7470 libname_spec="lib\$name"
7472 # List of archive names. First name is the real one, the rest are links.
7473 # The last name is the one that the linker finds with -lNAME.
7474 library_names_spec="\$libname.dll.a"
7476 # The coded name of the library, if different from the real name.
7477 soname_spec="\`echo \${libname} | sed -e s/^lib/cyg/\`\`echo \${release} | \$SED -e s/[.]/-/g\`\${versuffix}\${shared_ext}"
7479 # Commands used to build and install an old-style archive.
7480 RANLIB="ranlib"
7481 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
7482 old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
7483 old_postuninstall_cmds=""
7485 # Create an old-style archive from a shared archive.
7486 old_archive_from_new_cmds=""
7488 # Create a temporary old-style archive to link instead of a shared archive.
7489 old_archive_from_expsyms_cmds=""
7491 # Commands used to build and install a shared archive.
7492 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"
7493 archive_expsym_cmds="if test \\\"x\\\`\$SED 1q \$export_symbols\\\`\\\" = xEXPORTS; then
7494 cp \$export_symbols \$output_objdir/\$soname.def;
7495 else
7496 echo EXPORTS > \$output_objdir/\$soname.def;
7497 cat \$export_symbols >> \$output_objdir/\$soname.def;
7499 \$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"
7500 postinstall_cmds="base_file=\\\`basename \\\${file}\\\`~
7501 dlpath=\\\`\$SHELL 2>&1 -c '. \$dir/'\\\${base_file}'i;echo \\\$dlname'\\\`~
7502 dldir=\$destdir/\\\`dirname \\\$dlpath\\\`~
7503 test -d \\\$dldir || mkdir -p \\\$dldir~
7504 \$install_prog \$dir/\$dlname \\\$dldir/\$dlname~
7505 chmod a+x \\\$dldir/\$dlname"
7506 postuninstall_cmds="dldll=\\\`\$SHELL 2>&1 -c '. \$file; echo \\\$dlname'\\\`~
7507 dlpath=\$dir/\\\$dldll~
7508 \$rm \\\$dlpath"
7510 # Commands used to build a loadable module (assumed same as above if empty)
7511 module_cmds=""
7512 module_expsym_cmds=""
7514 # Commands to strip libraries.
7515 old_striplib="strip --strip-debug"
7516 striplib="strip --strip-unneeded"
7518 # Dependencies to place before the objects being linked to create a
7519 # shared library.
7520 predep_objects=""
7522 # Dependencies to place after the objects being linked to create a
7523 # shared library.
7524 postdep_objects=""
7526 # Dependencies to place before the objects being linked to create a
7527 # shared library.
7528 predeps=""
7530 # Dependencies to place after the objects being linked to create a
7531 # shared library.
7532 postdeps="-lstdc++ -lgcc -lmsys-1.0 -luser32 -lkernel32 -ladvapi32 -lshell32 -lgcc"
7534 # The directories searched by this compiler when creating a shared
7535 # library
7536 compiler_lib_search_dirs="/usr/lib /usr/lib /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 /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"
7538 # The library search path used internally by the compiler when linking
7539 # a shared library.
7540 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"
7542 # Method to check whether dependent libraries are shared objects.
7543 deplibs_check_method=pass_all
7545 # Command to use when deplibs_check_method == file_magic.
7546 file_magic_cmd="\$OBJDUMP -f"
7548 # Flag that allows shared libraries with undefined symbols to be built.
7549 allow_undefined_flag="unsupported"
7551 # Flag that forces no undefined symbols.
7552 no_undefined_flag=""
7554 # Commands used to finish a libtool library installation in a directory.
7555 finish_cmds=""
7557 # Same as above, but a single script fragment to be evaled but not shown.
7558 finish_eval=""
7560 # Take the output of nm and produce a listing of raw symbols and C names.
7561 global_symbol_pipe=""
7563 # Transform the output of nm in a proper C declaration
7564 global_symbol_to_cdecl=""
7566 # Transform the output of nm in a C name address pair
7567 global_symbol_to_c_name_address=""
7569 # This is the shared library runtime path variable.
7570 runpath_var=LD_RUN_PATH
7572 # This is the shared library path variable.
7573 shlibpath_var=PATH
7575 # Is shlibpath searched before the hard-coded library search path?
7576 shlibpath_overrides_runpath=yes
7578 # How to hardcode a shared library path into an executable.
7579 hardcode_action=immediate
7581 # Whether we should hardcode library paths into libraries.
7582 hardcode_into_libs=no
7584 # Flag to hardcode $libdir into a binary during linking.
7585 # This must work even if $libdir does not exist.
7586 hardcode_libdir_flag_spec="-L\$libdir"
7588 # If ld is used when linking, flag to hardcode $libdir into
7589 # a binary during linking. This must work even if $libdir does
7590 # not exist.
7591 hardcode_libdir_flag_spec_ld=""
7593 # Whether we need a single -rpath flag with a separated argument.
7594 hardcode_libdir_separator=""
7596 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
7597 # resulting binary.
7598 hardcode_direct=no
7600 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
7601 # resulting binary.
7602 hardcode_minus_L=no
7604 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
7605 # the resulting binary.
7606 hardcode_shlibpath_var=unsupported
7608 # Set to yes if building a shared library automatically hardcodes DIR into the library
7609 # and all subsequent libraries and executables linked against it.
7610 hardcode_automatic=no
7612 # Variables whose values should be saved in libtool wrapper scripts and
7613 # restored at relink time.
7614 variables_saved_for_relink="PATH PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
7616 # Whether libtool must link a program against all its dependency libraries.
7617 link_all_deplibs=unknown
7619 # Compile-time system search path for libraries
7620 sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
7622 # Run-time system search path for libraries
7623 sys_lib_dlsearch_path_spec="/lib /usr/lib"
7625 # Fix the shell variable $srcfile for the compiler.
7626 fix_srcfile_path=""
7628 # Set to yes if exported symbols are required.
7629 always_export_symbols=no
7631 # The commands to list exported symbols.
7632 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"
7634 # The commands to extract the exported symbol list from a shared archive.
7635 extract_expsyms_cmds=""
7637 # Symbols that should not be listed in the preloaded symbols.
7638 exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
7640 # Symbols that must always be exported.
7641 include_expsyms=""
7643 # ### END LIBTOOL TAG CONFIG: CXX
7645 # ### BEGIN LIBTOOL TAG CONFIG: F77
7647 # Libtool was configured on host Felix-Maschine:
7649 # Shell to use when invoking shell scripts.
7650 SHELL="/bin/sh"
7652 # Whether or not to build shared libraries.
7653 build_libtool_libs=yes
7655 # Whether or not to build static libraries.
7656 build_old_libs=no
7658 # Whether or not to add -lc for building shared libraries.
7659 build_libtool_need_lc=no
7661 # Whether or not to disallow shared libs when runtime libs are static
7662 allow_libtool_libs_with_static_runtimes=yes
7664 # Whether or not to optimize for fast installation.
7665 fast_install=needless
7667 # The host system.
7668 host_alias=
7669 host=i686-pc-cygwin
7670 host_os=cygwin
7672 # The build system.
7673 build_alias=i686-pc-cygwin
7674 build=i686-pc-cygwin
7675 build_os=cygwin
7677 # An echo program that does not interpret backslashes.
7678 echo="echo"
7680 # The archiver.
7681 AR="ar"
7682 AR_FLAGS="cru"
7684 # A C compiler.
7685 LTCC="gcc"
7687 # LTCC compiler flags.
7688 LTCFLAGS="-g -O2"
7690 # A language-specific compiler.
7691 CC="g77"
7693 # Is the compiler the GNU C compiler?
7694 with_gcc=yes
7696 # An ERE matcher.
7697 EGREP="/bin/grep -E"
7699 # The linker used to build libraries.
7700 LD="/i686-pc-msys/bin/ld.exe"
7702 # Whether we need hard or soft links.
7703 LN_S="cp -p"
7705 # A BSD-compatible nm program.
7706 NM="/bin/nm -B"
7708 # A symbol stripping program
7709 STRIP="strip"
7711 # Used to examine libraries when file_magic_cmd begins "file"
7712 MAGIC_CMD=file
7714 # Used on cygwin: DLL creation program.
7715 DLLTOOL="dlltool"
7717 # Used on cygwin: object dumper.
7718 OBJDUMP="objdump"
7720 # Used on cygwin: assembler.
7721 AS="as"
7723 # The name of the directory that contains temporary libtool files.
7724 objdir=.libs
7726 # How to create reloadable object files.
7727 reload_flag=" -r"
7728 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
7730 # How to pass a linker flag through the compiler.
7731 wl="-Wl,"
7733 # Object file suffix (normally "o").
7734 objext="o"
7736 # Old archive suffix (normally "a").
7737 libext="a"
7739 # Shared library suffix (normally ".so").
7740 shrext_cmds='.dll'
7742 # Executable file suffix (normally "").
7743 exeext=""
7745 # Additional compiler flags for building library objects.
7746 pic_flag=" -DDLL_EXPORT"
7747 pic_mode=default
7749 # What is the maximum length of a command?
7750 max_cmd_len=8192
7752 # Does compiler simultaneously support -c and -o options?
7753 compiler_c_o="yes"
7755 # Must we lock files when doing compilation?
7756 need_locks="no"
7758 # Do we need the lib prefix for modules?
7759 need_lib_prefix=no
7761 # Do we need a version for libraries?
7762 need_version=no
7764 # Whether dlopen is supported.
7765 dlopen_support=unknown
7767 # Whether dlopen of programs is supported.
7768 dlopen_self=unknown
7770 # Whether dlopen of statically linked programs is supported.
7771 dlopen_self_static=unknown
7773 # Compiler flag to prevent dynamic linking.
7774 link_static_flag=""
7776 # Compiler flag to turn off builtin functions.
7777 no_builtin_flag=""
7779 # Compiler flag to allow reflexive dlopens.
7780 export_dynamic_flag_spec="\${wl}--export-dynamic"
7782 # Compiler flag to generate shared objects directly from archives.
7783 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
7785 # Compiler flag to generate thread-safe objects.
7786 thread_safe_flag_spec=""
7788 # Library versioning type.
7789 version_type=windows
7791 # Format of library name prefix.
7792 libname_spec="lib\$name"
7794 # List of archive names. First name is the real one, the rest are links.
7795 # The last name is the one that the linker finds with -lNAME.
7796 library_names_spec="\$libname.dll.a"
7798 # The coded name of the library, if different from the real name.
7799 soname_spec="\`echo \${libname} | sed -e s/^lib/cyg/\`\`echo \${release} | \$SED -e s/[.]/-/g\`\${versuffix}\${shared_ext}"
7801 # Commands used to build and install an old-style archive.
7802 RANLIB="ranlib"
7803 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
7804 old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
7805 old_postuninstall_cmds=""
7807 # Create an old-style archive from a shared archive.
7808 old_archive_from_new_cmds=""
7810 # Create a temporary old-style archive to link instead of a shared archive.
7811 old_archive_from_expsyms_cmds=""
7813 # Commands used to build and install a shared archive.
7814 archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib"
7815 archive_expsym_cmds="if test \\\"x\\\`\$SED 1q \$export_symbols\\\`\\\" = xEXPORTS; then
7816 cp \$export_symbols \$output_objdir/\$soname.def;
7817 else
7818 echo EXPORTS > \$output_objdir/\$soname.def;
7819 cat \$export_symbols >> \$output_objdir/\$soname.def;
7821 \$CC -shared \$output_objdir/\$soname.def \$libobjs \$deplibs \$compiler_flags -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib"
7822 postinstall_cmds="base_file=\\\`basename \\\${file}\\\`~
7823 dlpath=\\\`\$SHELL 2>&1 -c '. \$dir/'\\\${base_file}'i;echo \\\$dlname'\\\`~
7824 dldir=\$destdir/\\\`dirname \\\$dlpath\\\`~
7825 test -d \\\$dldir || mkdir -p \\\$dldir~
7826 \$install_prog \$dir/\$dlname \\\$dldir/\$dlname~
7827 chmod a+x \\\$dldir/\$dlname"
7828 postuninstall_cmds="dldll=\\\`\$SHELL 2>&1 -c '. \$file; echo \\\$dlname'\\\`~
7829 dlpath=\$dir/\\\$dldll~
7830 \$rm \\\$dlpath"
7832 # Commands used to build a loadable module (assumed same as above if empty)
7833 module_cmds=""
7834 module_expsym_cmds=""
7836 # Commands to strip libraries.
7837 old_striplib="strip --strip-debug"
7838 striplib="strip --strip-unneeded"
7840 # Dependencies to place before the objects being linked to create a
7841 # shared library.
7842 predep_objects=""
7844 # Dependencies to place after the objects being linked to create a
7845 # shared library.
7846 postdep_objects=""
7848 # Dependencies to place before the objects being linked to create a
7849 # shared library.
7850 predeps=""
7852 # Dependencies to place after the objects being linked to create a
7853 # shared library.
7854 postdeps=""
7856 # The directories searched by this compiler when creating a shared
7857 # library
7858 compiler_lib_search_dirs=""
7860 # The library search path used internally by the compiler when linking
7861 # a shared library.
7862 compiler_lib_search_path=""
7864 # Method to check whether dependent libraries are shared objects.
7865 deplibs_check_method=pass_all
7867 # Command to use when deplibs_check_method == file_magic.
7868 file_magic_cmd="\$OBJDUMP -f"
7870 # Flag that allows shared libraries with undefined symbols to be built.
7871 allow_undefined_flag="unsupported"
7873 # Flag that forces no undefined symbols.
7874 no_undefined_flag=""
7876 # Commands used to finish a libtool library installation in a directory.
7877 finish_cmds=""
7879 # Same as above, but a single script fragment to be evaled but not shown.
7880 finish_eval=""
7882 # Take the output of nm and produce a listing of raw symbols and C names.
7883 global_symbol_pipe=""
7885 # Transform the output of nm in a proper C declaration
7886 global_symbol_to_cdecl=""
7888 # Transform the output of nm in a C name address pair
7889 global_symbol_to_c_name_address=""
7891 # This is the shared library runtime path variable.
7892 runpath_var=LD_RUN_PATH
7894 # This is the shared library path variable.
7895 shlibpath_var=PATH
7897 # Is shlibpath searched before the hard-coded library search path?
7898 shlibpath_overrides_runpath=yes
7900 # How to hardcode a shared library path into an executable.
7901 hardcode_action=immediate
7903 # Whether we should hardcode library paths into libraries.
7904 hardcode_into_libs=no
7906 # Flag to hardcode $libdir into a binary during linking.
7907 # This must work even if $libdir does not exist.
7908 hardcode_libdir_flag_spec="-L\$libdir"
7910 # If ld is used when linking, flag to hardcode $libdir into
7911 # a binary during linking. This must work even if $libdir does
7912 # not exist.
7913 hardcode_libdir_flag_spec_ld=""
7915 # Whether we need a single -rpath flag with a separated argument.
7916 hardcode_libdir_separator=""
7918 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
7919 # resulting binary.
7920 hardcode_direct=no
7922 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
7923 # resulting binary.
7924 hardcode_minus_L=no
7926 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
7927 # the resulting binary.
7928 hardcode_shlibpath_var=unsupported
7930 # Set to yes if building a shared library automatically hardcodes DIR into the library
7931 # and all subsequent libraries and executables linked against it.
7932 hardcode_automatic=no
7934 # Variables whose values should be saved in libtool wrapper scripts and
7935 # restored at relink time.
7936 variables_saved_for_relink="PATH PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
7938 # Whether libtool must link a program against all its dependency libraries.
7939 link_all_deplibs=unknown
7941 # Compile-time system search path for libraries
7942 sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
7944 # Run-time system search path for libraries
7945 sys_lib_dlsearch_path_spec="/lib /usr/lib"
7947 # Fix the shell variable $srcfile for the compiler.
7948 fix_srcfile_path=""
7950 # Set to yes if exported symbols are required.
7951 always_export_symbols=no
7953 # The commands to list exported symbols.
7954 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED -e '/^[BCDGRS][ ]/s/.*[ ]\\\\([^ ]*\\\\)/\\\\1 DATA/' -e '/^[AITW][ ]/s/.*[ ]//' | sort | uniq > \$export_symbols"
7956 # The commands to extract the exported symbol list from a shared archive.
7957 extract_expsyms_cmds=""
7959 # Symbols that should not be listed in the preloaded symbols.
7960 exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
7962 # Symbols that must always be exported.
7963 include_expsyms=""
7965 # ### END LIBTOOL TAG CONFIG: F77